{"action":"closed","issue":{"url":"https://api.github.com/repos/HenrikBengtsson/listenv/issues/1","labels_url":"https://api.github.com/repos/HenrikBengtsson/listenv/issues/1/labels{/name}","comments_url":"https://api.github.com/repos/HenrikBengtsson/listenv/issues/1/comments","events_url":"https://api.github.com/repos/HenrikBengtsson/listenv/issues/1/events","html_url":"https://github.com/HenrikBengtsson/listenv/issues/1","id":98138487,"number":1,"title":"CONSISTENCY: Assigning NULL to element does not drop element as for list():s - should it?","user":{"login":"HenrikBengtsson","id":1616850,"avatar_url":"https://avatars.githubusercontent.com/u/1616850?v=3","gravatar_id":"","url":"https://api.github.com/users/HenrikBengtsson","html_url":"https://github.com/HenrikBengtsson","followers_url":"https://api.github.com/users/HenrikBengtsson/followers","following_url":"https://api.github.com/users/HenrikBengtsson/following{/other_user}","gists_url":"https://api.github.com/users/HenrikBengtsson/gists{/gist_id}","starred_url":"https://api.github.com/users/HenrikBengtsson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/HenrikBengtsson/subscriptions","organizations_url":"https://api.github.com/users/HenrikBengtsson/orgs","repos_url":"https://api.github.com/users/HenrikBengtsson/repos","events_url":"https://api.github.com/users/HenrikBengtsson/events{/privacy}","received_events_url":"https://api.github.com/users/HenrikBengtsson/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/HenrikBengtsson/listenv/labels/enhancement","name":"enhancement","color":"84b6eb"},{"url":"https://api.github.com/repos/HenrikBengtsson/listenv/labels/question","name":"question","color":"cc317c"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-07-30T10:42:16Z","updated_at":"2015-08-03T00:04:31Z","closed_at":"2015-08-03T00:04:31Z","body":"# Question\r\nShould assignment of `NULL` to an element drop the element as it does for regular lists?  Currently it does not, but it assigns the value `NULL`.\r\n\r\n# Example\r\nCompare:\r\n```r\r\n> x <- list()\r\n> x$a <- NULL\r\n> str(as.list(x))\r\n list()\r\n```\r\nwith:\r\n```r\r\n> library(listenv)\r\n> y <- listenv()\r\n> y$a <- NULL\r\n> str(as.list(y))\r\nList of 1\r\n $ a: NULL\r\n```\r\n\r\n# Suggestion\r\nWe could add an argument that controls the behavior, e.g.\r\n```r\r\ny <- listenv(dropIfNULL=TRUE)\r\n```\r\nIf so, it should also support assigning `NULL` by\r\n```r\r\ny[\"a\"] <- list(NULL)\r\n```\r\nMaybe the above should be the default?"}}