[R] Plotting Time Series

John Davis jmd at isharp.com
Thu May 25 02:11:57 CEST 2000


I'm new to R and reading Modern Applied Statistics w/ S-Plus (read the
first two chapters and am skimming the chapter 13). I'm trying to take
data of the form:

Time Attribute Frequency
1       A       7
1       B       12
2       A       6
2       C       4
2       D       7
4       B       11
4       D       5
5       A       9
5       B       11
5       C       14
   [...]

and create a time series (Time ~ Frequency) for each attribute in the
same plot somewhat similar to Figure 13.1 on page 403 (which plot I
can reproduce following ch13.R).

There are a few ways I've thought to address this:

1. Rearrange the data into one file for each attribute

eg.

File_A
1 7
2 6
5 9

Then plot each in the same plot...

2. Read the data from one file, then use the factors to create vectors
   of different lengths holding the time and freq data.

3. Divine some magic about factors and do it all with some incredible
   one liner.

The last is where I'd like to get to, but I need a better mental model
of what is going on... Presently, I'm just "trying stuff". Anyway, any
clues would be appreciated, about the problem itself, or about the
"trying stuff" approach to R.

Regards, jd
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list