Hi helpeRs,

I have inherited a set of data files that use the file system as a
sort of poor man's database, i.e., the data files are nested in
directories that indicate which city they come from. For example:

dir.create("deleteme")
for(i in paste("deleteme", c("New York", "Los Angeles"), sep="/")) {
    dir.create(i)
    for(j in paste("data", 1:2, ".csv", sep="")) {
        write.csv(data.frame(x=1:10), file=paste(i, j, sep="/"))
    }
}

list.files("deleteme", recursive=TRUE)

What I want to end up with is

  x        city wave
  1    New York    1
  1 Los Angeles    1
  1    New York    2
  1 Los Angeles    2

I've started writting a simple function to do this, but it seems like
a common situation and I'm wondering if there are any packages or
functions that might make this easier.

Thanks!
Ista
-- 
Ista Zahn
Graduate student
University of Rochester
Department of Clinical and Social Psychology
http://yourpsyche.org

______________________________________________
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.

Reply via email to