Check out #2 in:
http://finzi.psych.upenn.edu/R/Rhelp02a/archive/85801.html
and RSiteSearch(axis(4) to find additional examples.
On 1/4/07, Arun Kumar Saha [EMAIL PROTECTED] wrote:
Dear Gabor,
Thank you very much for your letter. Actually I got partial solution from
your suggestion. Still I
@stat.math.ethz.ch
Subject:Re: [R] Time series plot
Dear Gabor,
Thank you very much for your letter. Actually I got partial solution
from your suggestion. Still I am fighting with defining a secondary
axis. More pecisely, suppose I have following two dataset:
x = c(1:10)
y = x*10
Here's an example illustrating a way to get a second y axis that has
a different range:
x - 1:10
y1 - 2*x
y2 - 100-3*x+rnorm(10)
par(mar=c(5.1,4.1,4.1,4.1))
plot(x,y1)
par(new=TRUE)
plot(x,y2,xaxt='n',yaxt='n',xlab='',ylab='',pch=3)
axis(4)
mtext('y2',side=4,line=2.5)
-Don
At 2:18 PM +0530
Dear all R users,
Suppose I have a data set like this:
date price
1-Jan-02 4.8803747
2-Jan-02 4.8798430
3-Jan-02 4.8840133
4-Jan-02 4.8803747
5-Jan-02 4.8749683
6-Jan-02 4.8754263
7-Jan-02 4.8746628
8-Jan-02 4.8753500
9-Jan-02 4.8882416
10-Jan-02
You can use read.zoo in the zoo package to read in the data
and then see:
https://www.stat.math.ethz.ch/pipermail/r-help/2006-December/122742.html
See ?axis for creating additional axes with classic graphics and
library(lattice)
?panel.axis
in lattice graphics. Search the archives for
, ...)
The AT and LABELS options in axis I fill with something like:
at.x - seq(as.Date(2006-01-01), as.Date(2006-05-30), month)
lab.x - paste(format(at.x, %b), c(rep('06, 5)))
So only the month will appear as labels and tickmarks...
HTH
Dubravko
YOU WROTE:
[R] Time series plot
I have some time series data like
01/02/1990 0.531 0.479
01/03/1990 0.510 0.522
01/06/1990 0.602 0.604
there is no weekends and holidays.
how do I graph them in a single plot that the x-axis is the dates and
the y-axis is the time series?
Thank you
Regards,
Jincai Jiang
(Office)
Try this (where you can replace textConnection(L) with name
of file containing data):
L - 01/02/1990 0.531 0.479
01/03/1990 0.510 0.522
01/06/1990 0.602 0.604
library(zoo)
z - read.zoo(textConnection(L), format = %m/%d/%Y)
plot(z, plot.type = single)
This will give more info on zoo:
Costas Vorlow wrote:
Hello,
I am trying to rotate by 90 degrees a time series plot. So I need the
time axis to be the vertical one. Is there an easy way?
No, you have to do it manually, AFAIK.
Uwe Ligges
I couldn't guess anything from the help pages.
Apologies for a silly question.
Regards,
Hello,
I am trying to rotate by 90 degrees a time series plot. So I need the
time axis to be the vertical one. Is there an easy way?
I couldn't guess anything from the help pages.
Apologies for a silly question.
Regards,
Costas
--
=
10 matches
Mail list logo