s-news
[Top] [All Lists]

plotting points on a time series graph

To: s-news@lists.biostat.wustl.edu
Subject: plotting points on a time series graph
From: "Burbidge, Robert" <robert.burbidge@csfb.com>
Date: Thu, 24 Oct 2002 16:44:15 +0100
Hello list members,

I would like to plot a timeSeries as a line, and superimpose events as points.

# series
x <- 1:100
x.ts    <-      timeSeries(x, x)

# events
y <- seq(10, 100, by = 10)
y.ts <- timeSeries(y, y)

# ok as individual plots
plot(x.ts, plot.args=list(type="l"))
plot(y.ts, plot.args=list(type="p"))

# also ok if both are plotted as points
plot(x.ts, y.ts, plot.args=list(type="p"), merge.args=(list(pos="union")))

# but the following plots both as lines
plot(x.ts, y.ts, plot.args=list(type="lp"), merge.args=(list(pos="union")))

the second character, "p", of type is ignored

I have also tried

plot(x.ts, plot.args=list(type="l"))
ts.points(y.ts)

Problem in points.raw.Internal(x = structure(.Data = c(1., 2., 3., 4., 5., 6., 
7., 8., ..: can't interpret class "timeSeries" as an S Version 2 vector 

and

plot(x.ts, plot.args=list(type="l"))
tspoints(y.ts)

Problem: can't interpret class "timeSeries" as an S Version 2 vector 

Any suggestions would be appreciated.

S-PLUS 6.1 for Windows License Managed Edition Release 1 on NT4

Rgds

Robert

This message is for the named person's use only. It may contain sensitive and 
private proprietary or legally privileged information. No confidentiality or 
privilege is waived or lost by any mistransmission. If you are not the intended 
recipient, please immediately delete it and all copies of it from your system, 
destroy any hard copies of it and notify the sender. You must not, directly or 
indirectly, use, disclose, distribute, print, or copy any part of this message 
if you are not the intended recipient. CREDIT SUISSE GROUP and each legal 
entity in the CREDIT SUISSE FIRST BOSTON or CREDIT SUISSE ASSET MANAGEMENT 
business units of CREDIT SUISSE FIRST BOSTON reserve the right to monitor all 
e-mail communications through its networks. Any views expressed in this message 
are those of the individual sender, except where the message states otherwise 
and the sender is authorized to state them to be the views of any such entity.
Unless otherwise stated, any pricing information given in this message is 
indicative  only, is subject to change and does not constitute an offer to deal 
at any price quoted. Any reference to the terms of executed transactions should 
be treated as  preliminary only and subject to our formal written confirmation.



<Prev in Thread] Current Thread [Next in Thread>