Nirmala sent a nice message to R-help yesterday. Within 12 hours, she had two
answers, the second from one of the core developers of R, Brian Ripley.
One of the many reasons that we choose R for GOV 1000 (and all future GOV
empirical classes) is that this level of support is simply unavaible for any
other statistical package.
And it is free.
In terms of constructive criticism, the main thing that I would change about
Nirmala's post is that it should have provided code that creates the sample
dataframe y, as Ripley did in his reply. It is also customary to have a
somewhat more informative subject.
There is much to be learned from R help. Indeed, in recent days, as you can see
by browsing the archives, there have been a flurry of questions and answers
relating to lattice. Anyone doing serious methodology work should consider
subscribing to the list (I recommend the digest form) and reading the questions
and answers that seem interesting.
Anytime you receive answers to a question on R-help (or, indeed, anywhere), you
should send a nice thankyou e-mail to whoever took the time to help you out. If
you get a bunch of answers (especially if some of not cc'ed to the list), it is
customary to provide a summary post to the list of the original problem and the
various solutions, nicely organized, that were suggested.
Dave
Message: 11
Date: Mon, 6 Jan 2003 20:19:58 -0800 (PST)
From: Nirmala Ravishankar <n_ravishankar(a)yahoo.com>
To: r-help(a)stat.math.ethz.ch
Subject: [R] plot()
I am an R novice trying to figure out plot().
Specifically, I am trying to plot the values of a
numeric variable V for a set of years (1970, 1974,
1976, 1978, 1980). How do I get R to label the years
I am plotting on the x-axis rather then some general
levels (1970, 1975, 1980.) Using as.character(year)
doesn't seem to help, and using as.factor(year)
generates steps insteads of dots.
Help will be most appreciated. I have listed the code
I have been using below:
plot(y$year, y$V, type = "b")
plot(as.character(y$year), y$V, type = "b")
plot(as.character(y$year), y$V, type = "b")
Thanks,
NR
--__--__--
Message: 12
Date: Mon, 6 Jan 2003 23:36:44 -0500 (EST)
From: Yuelin Li <yuelin(a)mail.med.upenn.edu>
Reply-To: Yuelin Li <yuelin(a)mail.med.upenn.edu>
Subject: Re: [R] plot()
To: r-help(a)stat.math.ethz.ch, n_ravishankar(a)yahoo.com
try text(c("1970", "1978", "1990"), x=1:3, y=1:3) after you
first
call plot(c(1, 3), c(1, 3), axes=F, type="n", xlab="",
ylab="")
to set the plotting area.
Yuelin.
-- From: Nirmala Ravishankar <n_ravishankar(a)yahoo.com>
To: r-help(a)stat.math.ethz.ch
Subject: [R] plot()
Date: Mon, 6 Jan 2003 20:19:58 -0800 (PST)
I am an R novice trying to figure out plot().
Specifically, I am trying to plot the values of a
numeric variable V for a set of years (1970, 1974,
1976, 1978, 1980). How do I get R to label the years
I am plotting on the x-axis rather then some general
levels (1970, 1975, 1980.) Using as.character(year)
doesn't seem to help, and using as.factor(year)
generates steps insteads of dots.
Help will be most appreciated. I have listed the code
I have been using below:
plot(y$year, y$V, type = "b")
plot(as.character(y$year), y$V, type = "b")
plot(as.character(y$year), y$V, type = "b")
Thanks,
NR
______________________________________________
R-help(a)stat.math.ethz.ch mailing list
http://www.stat.math.ethz.ch/mailman/listinfo/r-help
--__--__--
Message: 13
Date: Tue, 7 Jan 2003 07:53:36 +0000 (GMT)
From: <ripley(a)stats.ox.ac.uk>
To: Nirmala Ravishankar <n_ravishankar(a)yahoo.com>
cc: <r-help(a)stat.math.ethz.ch>
Subject: Re: [R] plot()
First, it is usual to make plots with generic scales rather than label
each of the x values used, especially when they are irregularly spaced (as
here). But if you want to do that, use axis() to create your own axis.
Here's a test
y <- data.frame(year=c(1970, 1974, 1976, 1978, 1980), V=rnorm(5))
attach(y)
plot(year, V, type = "b", xaxt="n")
axis(1, year, year)
detach()
--
David Kane
Lecturer In Government
617-563-0122
dkane(a)latte.harvard.edu
Please avoid sending me Word or PowerPoint attachments.
See
http://www.fsf.org/philosophy/no-word-attachments.html