[R] Plotting a x axis from a vector with rownames

Sven Garbade garbade at psy.uni-muenchen.de
Mon Mar 4 15:32:03 CET 2002


Hi all,

suppose there is a vector y with rownames:

> y
 cond1  cond2  cond3  cond4 
78.952 87.308 86.490 74.040 

how can I easily plot this vector using the rownames? plot(y) gives me a
plot with a x-axis from 1 to 4 in 0.5 steps, also plot(rownames(y), y)
and plot(y ~ rownames(y) don't work. I know I can build a x-axis with
axis(1, ...), but in this case I need a character string like c("cond1,
"", "cond2", "", ...), because the x-axis has 7 tick marks. I'm
wondering about an easier way (like barplot does).

Thanks, Sven
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list