[R] (senza oggetto)

Heinz Tuechler tuechler at gmx.at
Thu Apr 16 11:37:45 CEST 2009


At 11:10 16.04.2009, giuseppeform at libero.it wrote:
>Dear all, I have a database x,y,value imported in R with read.table:
>
>dati<-
>read.table("dati.dat")
>
>value is a categorical data (land use) and i want to
>plot in the same colour the same land use. It is possible with R. Thanks a lot
>
>______________________________________________
>R-help at r-project.org mailing list
>https://stat.ethz.ch/mailman/listinfo/r-help
>PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
>and provide commented, minimal, self-contained, reproducible code.

Maybe, something like:

set.seed(726)
x <- runif(10)
y <- runif(10)
value <- sample(c('agric', 'urban', 'traffic'), 10, replace=TRUE)
plot(x, y, col=as.numeric(as.factor((value))),
      pch=as.numeric(as.factor((value))))

Heinz




More information about the R-help mailing list