Bug 15926 - list2env(list()) fails because names(list()) is NULL. Could it return an empty environment?
Summary: list2env(list()) fails because names(list()) is NULL. Could it return an emp...
Status: NEW
Alias: None
Product: R
Classification: Unclassified
Component: Language (show other bugs)
Version: R 3.1.0
Hardware: Other Other
: P5 minor
Assignee: R-core
URL:
Depends on:
Blocks:
 
Reported: 2014-08-08 19:58 UTC by Bill Dunlap
Modified: 2014-08-08 19:58 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Bill Dunlap 2014-08-08 19:58:53 UTC
Currently list2env(list()) throws an error, apparently because names(list()) is not a character vector.
   > E0 <- list2env(list())
   Error in list2env(list()) : 
     names(x) must be a character vector of the same length as x
Would it break things if this did the same as a zero-long list with a zero-long character names vector?
   > E1 <- list2env( structure(list(), names=character()) )
   > objects(E1, all=TRUE)
   character(0)