[R] Using the output of strsplit

James Rome jamesrome at gmail.com
Mon Jan 18 22:48:33 CET 2010

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)
But I need to split them back into the separate date and quarter. So I
used strsplit(), and get
> spl
[1] "2009-01-01" "60"       

[1] "2009-01-01" "61"       

[1] "2009-01-01" "62"       

[1] "2009-01-01" "63"       

[1] "2009-01-01" "68"       
. . .

But lists throw me. I want to get separate vectors of the date and
quarter out of my list. All the things I have seen extract rows from the
list. I need to extract columns.

Thanks list,
Jim Rome

More information about the R-help mailing list