ggplot2: cannot allocate vector of size 1.9 Gb

448 views
Skip to first unread message

xiongdi.zai.beijing

unread,
Mar 24, 2015, 7:25:14 AM3/24/15
to ggp...@googlegroups.com
Hello,

I am having difficulty running ggplot2 oon my machine.

> sessionInfo()
R version 3.1.0 (2014-04-10)
Platform: i386-w64-mingw32/i386 (32-bit)

locale:
[1] LC_COLLATE=English_United States.1252  LC_CTYPE=English_United States.1252   
[3] LC_MONETARY=English_United States.1252 LC_NUMERIC=C                          
[5] LC_TIME=English_United States.1252    

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

other attached packages:
[1] Formula_1.2-0   survival_2.38-1 lattice_0.20-29 HistData_0.7-5  MASS_7.3-40    

loaded via a namespace (and not attached):
[1] digest_0.6.6  gtable_0.1.2  splines_3.1.0 tools_3.1.0
> memory.limit(4000)
[1] 4000
> library(UsingR)
Loading required package: MASS
Loading required package: HistData
Loading required package: Hmisc
Loading required package: grid
Loading required package: lattice
Loading required package: survival
Loading required package: Formula
Loading required package: ggplot2
Error : cannot allocate vector of size 1.9 Gb
In addition: Warning messages:
1: package ‘UsingR’ was built under R version 3.1.3 
2: package ‘MASS’ was built under R version 3.1.3 
3: package ‘HistData’ was built under R version 3.1.1 
4: package ‘Hmisc’ was built under R version 3.1.3 
5: package ‘survival’ was built under R version 3.1.3 
6: package ‘Formula’ was built under R version 3.1.3 
7: package ‘ggplot2’ was built under R version 3.1.3 
Error: package ‘ggplot2’ could not be loaded
> library(ggplot2)
Error : cannot allocate vector of size 1.9 Gb
In addition: Warning message:
package ‘ggplot2’ was built under R version 3.1.3 
Error: package or namespace load failed for ‘ggplot2’

Can anyone please suggest a workaround or solution to this problem? Getting a 64-bit machine is not an option here unfortunately.

Thanks in advance.

Dario Strbenac

unread,
Mar 24, 2015, 9:00:09 PM3/24/15
to ggp...@googlegroups.com
I loaded UsingR on a 32-bit computer without an issue. Do you have lots of other applications open, which are using lots of RAM ? Loading that package uses only 268 MB. It's easy to run if you do not have much RAM already reserved by programs other than R.

xiongdi.zai.beijing

unread,
Mar 25, 2015, 1:01:27 AM3/25/15
to ggp...@googlegroups.com
Follow up.

I did an update of all the packages for my R install using:
> update.packages(ask='graphics',checkBuilt=TRUE)

Then did a reinstall of the ggplot2 package, now everything seems to be working just fine.

> install.packages("ggplot2")
Installing package into ‘C:/Users/xxxx/Documents/R/win-library/3.1’
(as ‘lib’ is unspecified)
trying URL 'http://cran.cnr.Berkeley.edu/bin/windows/contrib/3.1/ggplot2_1.0.1.zip'
Content type 'application/zip' length 2675835 bytes (2.6 MB)
opened URL
downloaded 2.6 MB

package ‘ggplot2’ successfully unpacked and MD5 sums checked

The downloaded binary packages are in
        C:\Users\xxxx\AppData\Local\Temp\RtmpykmjFl\downloaded_packages
> library("ggplot2")
> install.packages("UsingR")
Installing package into ‘C:/Users/xxxx/Documents/R/win-library/3.1’
(as ‘lib’ is unspecified)
trying URL 'http://cran.cnr.Berkeley.edu/bin/windows/contrib/3.1/UsingR_2.0-4.zip'
Content type 'application/zip' length 2074117 bytes (2.0 MB)
opened URL
downloaded 2.0 MB

package ‘UsingR’ successfully unpacked and MD5 sums checked

The downloaded binary packages are in
        C:\Users\xxxx\AppData\Local\Temp\RtmpykmjFl\downloaded_packages

> library(UsingR)
Loading required package: MASS
Loading required package: HistData
Loading required package: Hmisc
Loading required package: grid
Loading required package: lattice
Loading required package: survival
Loading required package: Formula

Attaching package: ‘Hmisc’

The following objects are masked from ‘package:base’:

    format.pval, round.POSIXt, trunc.POSIXt, units


Attaching package: ‘UsingR’

The following object is masked from ‘package:survival’:

    cancer

The following object is masked from ‘package:ggplot2’:

    movies


So, consider this problem solved.

Cheers.
Reply all
Reply to author
Forward
0 new messages