Re: [R] Automate a data load and merge

2009-06-12 Thread jim holtman
I think the last should be: output <- cast(i.melt, Item_name ~ label, sum) On Fri, Jun 12, 2009 at 9:27 AM, Jon Loehrke wrote: > Hi R list, >I would like to automate, or speed up the process from which I take > several separate datasets, stored in .csv formate, import and merge > the

Re: [R] Automate a data load and merge

2009-06-12 Thread jim holtman
See if this works for you: # read into a list and then rbind to single data frame input <- do.call(rbind, lapply(files, function(.file){ X <- read.csv(.file) X$label <- gsub('.csv$', '', .file) # add name X })) # use the reshape package require(reshape) i.melt <- melt(input, id=c("lab

[R] Automate a data load and merge

2009-06-12 Thread Jon Loehrke
Hi R list, I would like to automate, or speed up the process from which I take several separate datasets, stored in .csv formate, import and merge them by a common variable. So far I have greatly sped up the loading process but cannot think of a way to automate the merger of all da