[R] Plotting a large time series
drjimlemon at gmail.com
Mon Apr 25 05:15:37 CEST 2016
This is probably taking a long time. I first tried with 7x10^6 times
and values and it took several minutes. The following code does what I
Perhaps convert the time series to two ordinary vectors?
On Sat, Apr 23, 2016 at 9:37 PM, Adrian Mcmenamin <acm538 at york.ac.uk> wrote:
> 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[], myData[], type="l").
> If I use plot(myData[], myData[], 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]]
> R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see
> 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