[R] problem in pot with subset selection

Thomas Lumley tlumley at u.washington.edu
Mon Jul 21 18:02:03 CEST 2003


On Mon, 21 Jul 2003, Ronaldo Reis Jr. wrote:

> Hi,
>
> I try to make a selective plot, but it make an error. The subset only work
> with length < 4, it is correct?
>
> >
>
> plot((ocorrencia/isca)~frag,
> subset=especieama==c("grupo1","grupo2","grupo3","AnoplotermesSp1","NeocapritermesOpacus"),
> pch=c(1,2,3,4,5),xlab="Área (ha)",ylab="Proporção de iscas ocupadas por
> térmitas")
> Warning messages:  1: longer object length
> 	is not a multiple of shorter object length in: is.na(e1) | is.na(e2)
> 2: longer object length
> 	is not a multiple of shorter object length in: "==.default"(especieama,
> c("grupo1", "grupo2", "grupo3", "AnoplotermesSp1",
>
> I make the plot using points, but I want to know if this is a bug or real
> limitation in subset comparison.
>

No.

You probably wanted
   especieama %in% c("grupo1","grupo2","grupo3","AnoplotermesSp1","NeocapritermesOpacus")
rather than ==


	-thomas




More information about the R-help mailing list