[R] plot and subsets

Erich Neuwirth erich.neuwirth at univie.ac.at
Tue Nov 27 21:02:06 CET 2001


i had not tried
as.integer or as.numeric
i just tried the factor variable itself.
now i know better.

thanks for all the help


Ben Bolker wrote:
> 
>  e.g.: to plot with colors 1 and 2 (easiest) and plotting characters 1 and
> 16:
> 
> x <- runif(10)
> y <- runif(10)
> z <- factor(sample(1:2,size=10,replace=TRUE))
> plot(x,y,col=as.numeric(z),pch=c(1,16)[as.numeric(z)])
> 

--
Erich Neuwirth, Computer Supported Didactics Working Group
Visit our SunSITE at http://sunsite.univie.ac.at
Phone: +43-1-4277-38624 Fax: +43-1-4277-9386
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
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