[R] reaccessing array at a later date - trying to write it to file

Prof Brian Ripley ripley at stats.ox.ac.uk
Thu Nov 23 15:06:39 CET 2006


On Thu, 23 Nov 2006, Jenny Barnes wrote:

> Dear R-help community
>
> I am trying to write an R object (data.out) to a file in order to re-access it
> later and not have to re-load up the array with data every time. Here is the
> form of data.out
>
>> data.out <- list(lats=seq(88.542, -88.542, length=94),
> 		  lons=seq(0, 360-1.875, length=192),
> 		  date=vector(length=nyr*12),
> 		  data=array(NA, c(nyr*12, 94*192))
> )
>
> I tried
>> save(data.out, file="/home/jenny/data/data.out.RData", ascii=TRUE) and
> combination of ways to re-access it but I couldn't reaccess it and therefore use
> the data within.

What stopped you re-accessing it?  I would use

save(data.out, file="/home/jenny/data/data.out.RData")
....
load("/home/jenny/data/data.out.RData")

If that does not work, we need to see the transcript to (perhaps) 
understand why (and all the usual details about your environment: it is 
possible to save really large objects that you cannot restore on a 
32-bit machine).

-- 
Brian D. Ripley,                  ripley at stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595



More information about the R-help mailing list