The easiest way to do this is to use an lapply:
#in working directory
filelist <- list.files()
ranges <- lapply(filelist[grep(".*range\\.csv", filelist)], read.csv)
probs <- lapply(filelist[grep(".*probs\\.csv", filelist)], read.csv)
Hope this helps,
Greg
On 12/20/09 10:24 PM, Maithili Shiva wr
Hi
I'm not sure if I understood your problem correctly..
Perhaps you are looking for something like this?
Best regards,
Roger
Result <- c()
yourPath <- "c:\\temp"
filesInDir <- dir(yourPath)
for(file in filesInDir){
fileInfo <- paste(yourPath,file,sep="\\")
tmp <- read.csv(fileInfo)
# assign(fi
See the FAQs, particularly
"How can I save the result of each iteration in a loop into a separate
file?" which applies for the other way round as well.
Uwe Ligges
Maithili Shiva wrote:
Dear R helpers,
Suppose I am dealing with no of interest rates at a time and the no of interest rates I a
Dear R helpers,
Suppose I am dealing with no of interest rates at a time and the no of interest
rates I am selecting for my analysis is random i.e. it can be 2, can be 10 or
even higher. The R-code I had written (with the guidance of R helpers obviously
and I am really grateful to all of you)
4 matches
Mail list logo