Re: [R] Using the output of strsplit

2010-01-19 Thread jim holtman
'x' is a matrix and not a dataframe. You should be doing colnames(x) <- c("Date", "quarter") x[,"Date"] <- as.Date(x[,"Date"]) It would help if you took a look at the structure you were using to understand how to access. 'names' applied to a vector would give you the output for 13000 more entr

Re: [R] Using the output of strsplit

2010-01-19 Thread James Rome
This suggestion does not work. x seems to have twice the number of entries as spl. > x <- do.call(rbind, spl) > names(x) <- c('Date', 'quarter') > x$Date <- as.Date(x$Date) Error in x$Date : $ operator is invalid for atomic vectors > x$quarter <- as.numeric(x$quarter) Error in x$quarter : $ operato

Re: [R] Using the output of strsplit

2010-01-18 Thread Henrique Dallazuanna
Try this also: do.call(rbind, spl) On Mon, Jan 18, 2010 at 7:48 PM, James Rome wrote: > I successfully combined my data frames, and am now on my next hurdle. > > I had combined the data and quarter, and used tapply to count the > entries for each unique date/quarter pair. > ar= tapply(ewrgnd$gw,

Re: [R] Using the output of strsplit

2010-01-18 Thread Peter Alspach
"c" "C" > matrix(unlist(tempList), nrow=3, byrow=T)[,1] [1] "a" "b" "c" HTH Peter Alspach > -Original Message- > From: r-help-boun...@r-project.org > [mailto:r-help-boun...@r-project.org] On Behalf Of James Rom

[R] Using the output of strsplit

2010-01-18 Thread James Rome
I successfully combined my data frames, and am now on my next hurdle. I had combined the data and quarter, and used tapply to count the entries for each unique date/quarter pair. ar= tapply(ewrgnd$gw, list(ewrgnd$dq), sum) #for each date/quarter combination sums the gw (which are all 1) dq=row.n