Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Peculiar environment Issue in ggplot2_2.0.0: "Error in list2env(members, envir = e) " running R 3.1.1 #1444

Closed
anesthetize opened this issue Dec 22, 2015 · 6 comments · Fixed by #1468

Comments

@anesthetize
Copy link

Error in ggplot2 running R 3.1.1:

install.packages("ggplot2")
library(ggplot2)

a<-1:3
b<-4:6
c <- as.data.frame(cbind(a,b))

qplot(a,b,data=c)

This yields the following error:

Error in list2env(members, envir = e) : 
  names(x) must be a character vector of the same length as x

Please note that I'm running R on a Windows Machine with mapped network drives, as such UNC paths are not supported in R and I made appropriate changes in the .Renviron file using R_LIBS.

Session Info as below:

sessionInfo()
R version 3.1.1 (2014-07-10)
Platform: i386-w64-mingw32/i386 (32-bit)

locale:
[1] LC_COLLATE=English_Australia.1252  LC_CTYPE=English_Australia.1252    
LC_MONETARY=English_Australia.1252 LC_NUMERIC=C                       
LC_TIME=English_Australia.1252    

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] ggplot2_2.0.0

loaded via a namespace (and not attached):
[1] colorspace_1.2-6 grid_3.1.1       gtable_0.1.2     munsell_0.4.2
    plyr_1.8.3       Rcpp_0.12.2      scales_0.3.0     tools_3.1.1    
@anesthetize
Copy link
Author

Works on R 3.2.3, just not on 3.1.1

@anesthetize anesthetize changed the title Peculiar environment Issue in ggplot2_2.0.0: "Error in list2env(members, envir = e) " Peculiar environment Issue in ggplot2_2.0.0: "Error in list2env(members, envir = e) " running R 3.1.1 Dec 22, 2015
@snafu123
Copy link

I just noticed that this is the same problem I had installing on 3.0.2:

Error in list2env(members, envir = e) :
names(x) must be a character vector of the same length as x

i reported it yesterday so. the difference is that for me, the error occurred which prevented ggplot installation, not the runtime.

@jonrobinson2
Copy link

Hm any update on why this is happening? I am seeing this on R 3.1.1 as well.

@hadley
Copy link
Member

hadley commented Jan 4, 2016

I think this means we've accidentally made ggplot2 only work in 3.2.2. @wch did we do this in ggproto?

@wch
Copy link
Member

wch commented Jan 4, 2016

I tested this on 3.1.0. It looks like the source of the problem is that list2env errors if you give it an empty list:

 list2env(list())
# Error in list2env(list()) : 
#   names(x) must be a character vector of the same length as x

We can work around it by adding a check in ggproto for empty lists.

@kenkcchew
Copy link

when you create the list of dataframe, you must give a name to each dataframe within the list

@lock lock bot locked as resolved and limited conversation to collaborators Jun 19, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants