Tuesday, 15 September 2015

time series - Transform cell characters into column titles in R -



time series - Transform cell characters into column titles in R -

i have been working on 2 days , still cannot find answer. here problem:

i have set of info created function automatically extracting info source. looks this:

data week starting position title 2013-01-05 1 happy 2013-01-05 2 skyscraper 2013-01-05 3 hey brother 2013-01-05 4 trumpets 2013-01-05 5 monster 2013-01-05 6 somewhere know 2013-01-12 1 happy 2013-01-12 2 skyscraper 2013-01-12 3 hey brother 2013-01-12 4 trumpets 2013-01-12 5 monster 2013-01-12 6 somewhere know ... ... ...

i want transpose info can run time series analyses:

week starting happy skyscraper hey brother trumpets monster somewhere know 2013-01-05 1 2 3 4 5 6 2013-01-12 1 2 3 4 5 6 ... ... ... ... ... ... ...

this 1 way can think of analysing info set. please sense free suggest other ways. in advanced!

you may want have @ ?reshape

for instance:

reshape(data, v.names="position", timevar="title", idvar="week.starting", direction="wide")

r time-series

No comments:

Post a Comment