1

I am running the following code in R

sort1.name <- name[order("sessionid","qf","qn") , ]

My data frame is large, but I am not sure how to check its size. The error I am receiving is

Error in FUN(newX[, i], ...) : object 'vec' not found
In addition: Warning messages:
1: In `[.data.frame`(name, order("sessionid", "qf", "qn"), ) :
Reached total allocation of 3583Mb: see help(memory.size)
2: In `[.data.frame`(name, order("sessionid", "qf", "qn"), ) :
Reached total allocation of 3583Mb: see help(memory.size)

I am running on a windows 64 bit operating system. How can I increase memory..or what are my other options to deal with this problem. The size of my data frame is 2591935400 bytes. Do I have any options to deal with a data frame of this size? Is there a function other than order I can use to sort based on 3 columns?

megv
  • 1,421
  • 5
  • 24
  • 36
  • 1
    I use this wonderful function posted here by Dirk to see what's taking up space in my R session: http://stackoverflow.com/questions/1358003/tricks-to-manage-the-available-memory-in-an-r-session – Chase Dec 06 '11 at 18:39
  • 1
    You can find its approximate storage size with `object.size(df)`, and it's dimensions with `dim(df)`... – Josh O'Brien Dec 06 '11 at 18:40
  • 1
    @JoshuaUlrich "My data frame is large, but I am not sure how to check its size...How can I increase memory..or what are my other options to deal with this problem" – Alan Dec 06 '11 at 18:40
  • Nearly all the information you're looking for (including some of the things references in previous comments) can be found by following the instructions in the error message: read `help(memory.size)` and then any pages that that one links to, etc. – joran Dec 06 '11 at 18:43
  • I am trying the following Setting the amount of available memory manually: Close R, then right-click on your R program icon (the icon on your desktop or in your programs directory). Select "Properties", and then select the "Shortcut" tab. Look for the "Target" field and after the closing quotes around the location of the R executible, add: --max-mem-size=500M – megv Dec 06 '11 at 19:46
  • 2
    That code is not going to order the rows in a data.frame. Install more RAM and R will handle it easily (you need probably 2.5 times as much as the data at least), or use ff package for out-of-memory data.frames. – mdsumner Dec 06 '11 at 20:23

1 Answers1

4

Using a virtual machine with more memory solved the problem

megv
  • 1,421
  • 5
  • 24
  • 36