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
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
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
3 matches
Mail list logo