Re: [R] Reading through a group of .RData files

2007-12-11 Thread Henrik Bengtsson
Hi, depending on what you do and how (and why) you save objects in RData files in the first place, you might be interested in knowing of the loadObject()/saveObject() methods of R.utils, as well as loadCache()/saveCache() in R.cache. The R.utils methods are basically "clever" wrappers around load

Re: [R] Reading through a group of .RData files

2007-12-11 Thread Benilton Carvalho
set of objects whose names are listed in a character array (as returned by load) ? Thank you! -- TMK -- 212-460-5430 home 917-656-5351 cell > Date: Mon, 10 Dec 2007 14:31:19 -0500 > From: [EMAIL PROTECTED] > To: [EMAIL PROTECTED] > CC: [EMAIL PROTECTED] > Subject: Re: [R

Re: [R] Reading through a group of .RData files

2007-12-11 Thread Talbot Katz
500> From: [EMAIL PROTECTED]> To: [EMAIL > PROTECTED]> CC: [EMAIL PROTECTED]> Subject: Re: [R] Reading through a group > of .RData files> > note that load() returns, invisibly, a string with the > names of the > objects that were loaded. something in the lines of:&g

Re: [R] Reading through a group of .RData files

2007-12-10 Thread Prof Brian Ripley
On Mon, 10 Dec 2007, Talbot Katz wrote: > > Hi. > > I have a procedure that reads a directory, loops through a set of > particular .RData files, loading each one, and feeding its object(s) > into a function, as follows: > > cvListFiles<-list.files(fnDir); > for(i in grep(paste("^",pfnStub,".*\\.

Re: [R] Reading through a group of .RData files

2007-12-10 Thread Benilton Carvalho
note that load() returns, invisibly, a string with the names of the objects that were loaded. something in the lines of: myObj <- load(file.path(fnDir, cvListFiles[i])) myFunction(get(myObj)) rm(list=myObj) might be closer to what you want. moreover, if length(myObj) > 1, you might want sth lik

[R] Reading through a group of .RData files

2007-12-10 Thread Talbot Katz
Hi. I have a procedure that reads a directory, loops through a set of particular .RData files, loading each one, and feeding its object(s) into a function, as follows: cvListFiles<-list.files(fnDir); for(i in grep(paste("^",pfnStub,".*\\.RData$",sep=""),cvListFiles)){ load(paste(fnDir,cvList