Re: [R] loop through files in a dir

2004-03-19 Thread Pierre Kleiber
> help.search("string") or > help.search("concatenate") would probably have led you to it. Fred J. wrote: file.path and paste. thanks as a R starter, how could I have found out without posting a question. is there a way I could have searched the help files for a keyword or somthing? thank

Re: [R] loop through files in a dir

2004-03-19 Thread Fred J.
file.path and paste. thanks as a R starter, how could I have found out without posting a question. is there a way I could have searched the help files for a keyword or somthing? thanks __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mai

Re: [R] loop through files in a dir

2004-03-19 Thread Pierre Kleiber
?paste Fred J. wrote: d <- dir("c:/data") for (i in d){ dt <- read.csv(c("c:/data/",i),header=FALSE) } wouldn't work because c("c:/data",i) puts out "string" "string" where both strings need to be one string. how can I combinde both in one string, c:/data/i like the good old perl "I wish". than

Re: [R] loop through files in a dir

2004-03-19 Thread Douglas Bates
"Fred J." <[EMAIL PROTECTED]> writes: > d <- dir("c:/data") > for (i in d){ > dt <- read.csv(c("c:/data/",i),header=FALSE) > } > wouldn't work because c("c:/data",i) puts out "string" > "string" where both strings need to be one string. > how can I combinde both in one string, c:/data/i like >

Re: [R] loop through files in a dir

2004-03-19 Thread Fred J.
d <- dir("c:/data") for (i in d){ dt <- read.csv(c("c:/data/",i),header=FALSE) } wouldn't work because c("c:/data",i) puts out "string" "string" where both strings need to be one string. how can I combinde both in one string, c:/data/i like the good old perl "I wish". thanks ___

Re: [R] loop through files in a dir

2004-03-19 Thread Jeff Gentry
> I have data in many files in a directory, how can I > loop through the files in a given dir in-order-to > build a data.frame? Just use something like 'x <- dir(YOUR_ARGS_HERE)', and then you can do a loop like: for (i in x) { do something do something else etc ... } -J

[R] loop through files in a dir

2004-03-19 Thread Fred J.
Hello I have data in many files in a directory, how can I loop through the files in a given dir in-order-to build a data.frame? thanks __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting gu