[R] Plotting a large time series

Adrian Mcmenamin acm538 at york.ac.uk
Sat Apr 23 13:37:59 CEST 2016

I have a time series with many millions of points.

Each point is of the form (time, value) but where the value is 0 there is
no record - ie the data set is sparse.

If I plot this using plot(myData) I get a correct plot going from time 0 to
time 7x10e7.

Given that there are many millions of points (it's not *that* sparse), this
looks very busy.

But if I attempt to plot this as a line - plot(myData, type="l") - the plot
is wrong (it looks like solid semi-sinusoidal curves) and although the
x-axis is drawn from 0 to 7x10e7, the plotting stops at about 3x10e7.

The same thing is seen if I use plot(myData[[1]], myData[[2]], type="l").

If I use plot(myData[[2]], myData[[1]], type="l") I do get a line (albeit
that the orientation seems odd), but again, while the y-axis is drawn
between 0 and 7x10e7, the plotting again seems to stop at 3x10e7 or

What have I got wrong? How can I get a line (preferably with the standard


	[[alternative HTML version deleted]]

More information about the R-help mailing list