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

Jenny Barnes jmb at mssl.ucl.ac.uk
Thu Nov 23 14:35:59 CET 2006


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. 

I then tried 
> dput(data.out,file="/home/jmb/sst_precip/gribdata/data.out.RData", 
control="showAttributes")
#but the associated dget seemed to freeze my terminal window up and took much 
too long (I gave up after about 15 minutes) to read this file.

Does anybody have an idea about another way (or a way within these methods) to 
come back to my data within the list data.out (with all of its associated 
data.out$lats, data.out$lons, data.out$date, data.out$data) at a later stage to 
use the data within it to actually get on with some analysis? 

I appreciate your time in reading this and look forward to hearing any 
suggestions,

Sincerely,

Jenny Barnes






~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Jennifer Barnes
PhD student - long range drought prediction
Climate Extremes
Department of Space and Climate Physics
University College London
Holmbury St Mary, Dorking
Surrey
RH5 6NT
01483 204149
07916 139187
Web: http://climate.mssl.ucl.ac.uk



More information about the R-help mailing list