[R] Table to List Transformation Scenario

Gabor Grothendieck ggrothendieck at gmail.com
Wed Apr 21 21:34:22 CEST 2010


Assuming the date as id is the first column followed by 23 values, try
the read.reps function found here:

http://www.mail-archive.com/r-help@r-project.org/msg92123.html

like this:

DF <- read.csv("myfile", as.is = TRUE)
read.reps(DF, 23)

On Wed, Apr 21, 2010 at 2:24 PM, Idgarad <idgarad at gmail.com> wrote:
> I have a series of tables, one for each environment indicating a date (row)
> and a sample at each hour of the day (0 to 23)
>
> Test1 Table:
> Date,Hour1,Hour2,...Hour23
> 1/1/10,123,123,...,123
>
> I would like to model this as a time series but how can I translate the
> table into a list such that I can get:
>
> 1/1/10 00:00, 123
> 1/1/10 01:00, 123
> 1/1/10 02:00, 123
> ...
> 1/1/10 23:00, 123
>
> Any suggestions on how to get that kind of translation done in R?
>
> Idgarad
> --
> "Who is John Galt?"
>
>        [[alternative HTML version deleted]]
>
> ______________________________________________
> R-help at 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.
>



More information about the R-help mailing list