A good question for the list.
Nirmala Ravishankar writes:
Dear Dave,
I am trying to plot incumbency by year using plot() and two numeric
variables year and psi. Using type = "b" gets R to generate all the dots
and connect them with lines, but it refuses to label the x-axis
accordingly (1970, 1972, 1974 etc.) Instead it has levels (1970, 1975,
1985 etc. I have tried using as.character(year), but that doesn't make
any difference. I also tried as.factor(year) but that generates steps
though it does label the years.
Any ideas?
Nothing comes to mind.
However, you will often get better answers to your questions, both
from us and from public course like R-help, if you simplify your
question and make it easy for others to play with. See my postings to
R-help for examples. You want to send a few lines of R code that
someone can copy and paste to see what results you are getting. In
your case, you don't need to send real data, just some lines that
create fake dataframe with a "year" variable and so on.
Dave
- Nirmala
--
David Kane
Lecturer in Government
617-563-0122
dkane(a)latte.harvard.edu