[R] simple time series plot

R. Michael Weylandt michael.weylandt at gmail.com
Wed Apr 18 17:31:01 CEST 2012


The preferred format for time series will be something like this:

      Sensor1    Sensor2   Sensor3
T1  Read1_1  Read2_1  Read3_1
T2  Read1_2  Read2_2  Read3_2
T3  Read1_3  Read2_3  Read3_3

if you can get that. CSV separations are nice but not as essential as
the columnar organization. (It's possible with your other formats, but
it will be much harder)

Michael


On Wed, Apr 18, 2012 at 9:26 AM, phibo <pbolliger at mac.com> wrote:
> Thanks for your reply!
>
> As I write the script to export the data from the database myself, I'm free
> to sort the data (almost) at will.
>
> I can either export to CSV in the form of
>
> sensor1
> timestamp1, reading1, timestamp2, reading2, timestamp2, reading2...
> sensor2
> timestamp1, reading1, timestamp2, reading2, timestamp2, reading2...
>
> OR
>
> sensor1
> timestamp1, timestamp2, timestamp3, ...
> reading1, reading2, reading3, ...
> sensor2
> timestamp1, timestamp2, timestamp3, ...
> reading1, reading2, reading3, ...
>
> What is easier to read into a matrix? Sorry for asking such a stupid
> question. But I just couldn't figure out how to read in the CSV into a data
> structure that I could plot afterwards.
>
> THANKS for your help!
>
> --
> View this message in context: http://r.789695.n4.nabble.com/simple-time-series-plot-tp4565579p4567706.html
> Sent from the R help mailing list archive at Nabble.com.
>
> ______________________________________________
> 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