molten data: date
>
> # If I try to change it as
>
> cast(in.melt, date.yield_rate ~ file) # Gives following error.
> Error: Casting formula contains variables not found in molten data:
> date.yield_rate
>
> Sir, it will be a
> great help if you can guide me and once again
n data:
date.yield_rate
Sir, it will be a
great help if you can guide me and once again sinserely apologize for
reverting so late.
Regards
Amy
--- On Thu, 12/23/10, jim holtman wrote:
From: jim holtman
Subject: Re: [R] Writing a single output file
To: "Amy Milano"
Cc: r-hel
Many ways of doing this and you have to think about efficiency and
logisitcs of different approaches.
If the data is not large, you can read all n files into a list and then
combine. If data is very large, you may wish to read one file at a time,
combining and then deleting it before reading t
On Thu, Dec 23, 2010 at 8:07 AM, Amy Milano wrote:
> Dear R helpers!
>
> Let me first wish all of you "Merry Christmas and Very Happy New year 2011"
>
> "Christmas day is a day of Joy and Charity,
> May God make you rich in both" - Phillips Brooks
>
> ##
>
>> input <- do.call(rbind, lapply(fileNames, function(.name){
> + .data <- read.table(.name, header = TRUE, as.is = TRUE)
> + # add file name to the data
> + .data$file <- .name
> + .data
> + }))
You can simplify this a little with plyr:
fileNames <- list.files(pattern = "file.*.c
This should get you close:
> # get file names
> setwd('/temp')
> fileNames <- list.files(pattern = "file.*.csv")
> fileNames
[1] "file1.csv" "file2.csv" "file3.csv" "file4.csv"
> input <- do.call(rbind, lapply(fileNames, function(.name){
+ .data <- read.table(.name, header = TRUE, as.is = TRUE
Dear R helpers!
Let me first wish all of you "Merry Christmas and Very Happy New year 2011"
"Christmas day is a day of Joy and Charity,
May God make you rich in both" - Phillips Brooks
##
---
7 matches
Mail list logo