[R] Out of memory issue

Neotropical bat risk assessments neotropical.bats at gmail.com
Sat Apr 25 03:06:36 CEST 2009


   Hi all,
   Julian just reminded me I need to include the lines of code so here it is
   below.
   I am trying to run some plots on data, but when loading the CSV data file it
   doss that but in ggplot R is stopping and I am getting an out of memory
   error.
   >
   > d <- read.csv batcalls.rda
   Error: unexpected symbol in "d <- read.csv batcalls.rda"
   > attach(d)
   Error in attach(d) : object "d" not found
   > library(ggplot2)
   > print(qplot(Sc, Fc))
   Error in eval(expr, envir, enclos) : object "Sc" not found
   > data(batcalls)
   >     attach(batcalls)
   >     print(qplot(Fc,geom="density"))
   >     b<-kmeans(Fc,c(10,15,18,30))
   >    print(qplot(Sc,Fc,colour=as.factor(b$cluster)))
   >
   >   print(qplot(Dur,geom="density"))
   >     b<-kmeans(Dur,c(10,15,18,30))
   >    print(qplot(Dur,Fc,colour=as.factor(b$cluster)))
   > d <- read.csv ("C:/Rainey/RainyAllbats.csv")
   > attach(d)
          The following object(s) are masked from batcalls :
           Dc Dur Fc Fk Fmax Fmean Fmin Qk Qual S1 Sc st TBC Tc Tk
   > library(ggplot2)
   > print(qplot(Sc, Fc))
   Warning messages:
   1: In data.frame(..., check.names = FALSE) :
     Reached total allocation of 1535Mb: see help(memory.size)
   2: In data.frame(..., check.names = FALSE) :
     Reached total allocation of 1535Mb: see help(memory.size)
   3: Removed 1200249 rows containing missing values (geom_point).
   > data(d)
   Warning message:
   In data(d) : data set 'd' not found
   >     attach(d)
          The following object(s) are masked from d ( position 3 ) :
           Dc Dur Fc Filename Fk Fmax Fmean Fmin Qk Qual S1 Sc st TBC Tc Tk
          The following object(s) are masked from batcalls :
           Dc Dur Fc Fk Fmax Fmean Fmin Qk Qual S1 Sc st TBC Tc Tk
   >     print(qplot(Fc,geom="density"))
   There were 15 warnings (use warnings() to see them)
   >     b<-kmeans(Fc,c(10,15,18,30))
   Error in switch(nmeth, { : NA/NaN/Inf in foreign function call (arg 1)
   > f=jpeg(file="Sc x Fc.jpg")
   >    print(qplot(Sc,Fc,colour=as.factor(b$cluster)))
   Error in data.frame(colour = c(3L, 4L, 4L, 4L, 4L, 1L, 4L, 2L, 1L, 1L, :
     arguments imply differing number of rows: 9404, 2400489
   > dev.off()
   Anyway to tweak this somehow to get it to run?
   Using WinXP with 4 GB RAM
   Tnx
   Bruce



More information about the R-help mailing list