[R] plot()

Nirmala Ravishankar n_ravishankar at yahoo.com
Tue Jan 7 05:21:03 CET 2003


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




More information about the R-help mailing list