On Thu, Aug 27, 2009 at 9:55 AM, Stephen Tucker<brown_...@yahoo.com> wrote: > You may want to use the reshape package for this task: > >> library(reshape) >> recast(DF3,Show ~ Datetime, id.var=names(DF3),value="Measure") > Show 08/26/2009 11:30 AM 08/26/2009 9:30 AM > 1 Firefly 3 1 > 2 Red Dwarf 4 2 > > If you want to plot time series, you can do something like the following > >> mydf <- .Last.value ## save the output from above to mydf >> library(zoo) >> zobj <- zoo(`mode<-`(t(mydf),"numeric"), >> as.chron(strptime(names(mydf)[-1],"%m/%d/%Y %I:%M %p"))) >> plot(zobj) > > (zobj is a time series object of the zoo class)
Note that as.chron can take % codes directly so the as.chron portion can be shortened to: as.chron(names(mydf)[-1],"%m/%d/%Y %I:%M %p") ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.