Skip to content

using save() to work with objects that exceed memory capacity

3 messages · David Romano, R. Michael Weylandt

#
On Sat, Jul 28, 2012 at 10:48 AM, David Romano <romanod at grinnell.edu> wrote:
load("matfile") no?

It seems to work for me:

R> x <- matrix(1:9, ncol = 3)
R> saveobj <- function(obj, file){
+ save(list = obj, file = file)
+ }
R> exists("x")
[1] FALSE
R> saveobj("x", "amatrix.rdat")
R> rm(x)
R> load("amatrix.rdat")
R> x
     [,1] [,2] [,3]
[1,]    1    4    7
[2,]    2    5    8
[3,]    3    6    9

Cheers,
Michael