>>>>> "TK" == Talbot Katz <[EMAIL PROTECTED]> >>>>> on Mon, 10 Dec 2007 14:16:52 -0500 writes:
TK> Hi. TK> I have a procedure that reads a directory, loops through TK> a set of particular .RData files, loading each one, and TK> feeding its object(s) into a function, as follows: TK> cvListFiles<-list.files(fnDir); TK> for(i in grep(paste("^",pfnStub,".*\\.RData$",sep=""),cvListFiles)){ TK> load(paste(fnDir,cvListFiles[i],sep="/")); TK> myFunction(rliObject); TK> rm(rliObject); TK> }; [.............] I don't know where you got the idea to end R statements with ";". I find it atrocious. It just does not belong to the S language and its R implementation. Please don't do it -- it hurts the eyes of most experienced R users -- it's extra clutter -- internally each extra ";" is an extra empty statement OTOH, *please* do -- indent R code and -- use spaces to increase readability This would make your above code into something like cvListFiles <- list.files(fnDir) for(i in grep(paste("^", pfnStub,".*\\.RData$", sep = ""), cvListFiles)) { load(paste(fnDir, cvListFiles[i], sep = "/")) myFunction(rliObject) rm(rliObject) } Something many readers on this list will much prefer to your original, and hence start considering to look at .. Martin Maechler, (S user since ca. 1987; member of R-core) ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.