[R] Plotting all lines of a data frame

Uwe Ligges ligges at statistik.uni-dortmund.de
Fri Nov 22 18:57:19 CET 2002



Andre DOS ANJOS wrote:
> 
> Hello,
> 
>         I'm trying to use R to plot a series of events (contained in a
> data.frame) into a single plot. In this case, the data columns represent
> known time marks. I would like to visually see the timing between those
> marks, for all events at once. What would be the fastest way to make that?
> 
>         My data.frame is like this
>      event.1 event.2 event.3 ... event.N
> 1      0       52     87           563   # <<<- first event
> 2      12      63     99           570   # <<<- second event
> ...
> 50     301    350     387          799   # <<<- fiftieth event
> 
>         It is relatively easy to make it with plot() and then lines(), but
> that would have to use a for() loop, what compromises the speed in which I
> can have the results. I still have files with 5,000, sometimes 50,000
> events...

You can use the function 'lines' within apply() --- as well as other
functions.

Anyway, I don't believe the speed of the for() loop will be the major
problem - what about visualizing 50000 * #time.marks at once in one
plot? Do you think the plot will be very informative? 

Uwe Ligges
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
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