ggplot2 Error in initFields
Asked Answered
U

3

6

The function ggplotfrom package ggplot2 gives the following error:

Error in initFields(scales = scales) : 
cannot find function "initRefFields"

Went through other lists and found that updating ggplot2 or R to v.14.2 would make it work, however I did both, and still does not work. Any hint? there goes session info: THANKS!

> sessionInfo()
R version 2.14.2 (2012-02-29)
Platform: x86_64-pc-mingw32/x64 (64-bit)

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

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

other attached packages:
[1] plyr_1.7.1    ggplot2_0.9.0

loaded via a namespace (and not attached):
[1] colorspace_1.1-1   dichromat_1.2-4    digest_0.5.2       grid_2.14.0            MASS_7.3-16       
[6] memoise_0.1        munsell_0.3        proto_0.3-9.2      RColorBrewer_1.0-5    reshape2_1.2.1    
[11] scales_0.2.0       stringr_0.6        tools_2.14.0 
Ungraceful answered 25/3, 2012 at 20:11 Comment(4)
A bit of a longshot, but have you tried explicitly loading scales, library(scales)? Beyond that, it may be helpful if you provided a reproducible example (perhaps using one of the built in data sets, like mtcars) that generates the error?Refreshment
I have the same problem on OSX, R version 2.14.0. Almost identical sessionInfo except my locale is en_US. Explicitly loading scales. Just calling ggplot with no arguments gives the error, has nothing to do with a particular data set.Orellana
@JohnMcDonnell Having that error with 2.14.0 is a known error; you need 2.14.1 or higher.Reaganreagen
I run R 3.2.0 and ggplot2 1.0.1 and I am still facing the same problem. Check please: #30267232Hardandfast
O
3

Not particularly satisfying, but I solved this by upgrading R to 2.15.

EDIT: According to @Brian Diggs, this is a known issue in 2.14, fixed in 2.14.1.

Orellana answered 2/4, 2012 at 14:22 Comment(2)
Is it a lot better? I was told it was a little awkward to use but I haven't actually tried it.Orellana
I like ggplot2 much better myself. In lattice I spent a lot of time digging through the help docs to find a certain graphical parameter to change something. In ggplot2 the structure is much more logical, which makes working with it for me much less tedious.Mahmoud
R
2

Both @Agnus and @Amy seem to have had a problem with their installation/upgrade. Note that in both cases, the version of grid and tools listed is 2.14.0. These two packages ship with base R and should have the same version as R (2.14.2 or 2.15.0). This indicates to me that the standard packages did not get installed correctly, or something is causing the R installation to look in the wrong place for the core libraries.

I'm not sure what could cause this, or how to fix it short of installing the standard R (Windows, in both cases) distribution (again).

Reaganreagen answered 3/5, 2012 at 4:39 Comment(2)
A good option might be to uninstall everything (R, packages) and make a clean install. This may take some time, but ensures that you get a clean R installationMahmoud
That was my final option and it is now working. sorry for answering so late, i thought i would receive notifications of the answer in my email. thanks for the advice.AgusUngraceful
M
1

When copying libraries during upgrade from 2.14 to 2.14.2 or 2.15.x and doing the upgrade packages story as described in the FAQs, "tools" and "grid" are not updated back to the new version, thus, the old version 2.14 remains. This causes the trouble. A clean install or a re-install of 2.15.x eliminates the problem.

Mcglone answered 30/11, 2012 at 8:45 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.