[R] Using "|"
Sundar Dorai-Raj
sundar.dorai-raj at pdf.com
Tue May 3 17:57:24 CEST 2005
Jim Milks wrote on 5/3/2005 8:34 AM:
> Dear all,
>
> I have a rodent dataset that I am reanalyzing. The set consists of
> several variables (#Microtus captured, Grass stems/m^2, etc), among
> which is a Grid factor variable c(North,South). I have evidence that
> there are significant differences in vegetation and rodent populations
> between the two locations (from chi-square tests) and would like to run
> separate analyses along North/South lines on the rest of my data. For
> example, I type:
>
> > plot(Microtus.T~Grass | Grid)
>
> However, I get the following:
>
> Error in plot.window(xlim, ylim, log, asp, ...) :
> need finite xlim values
> In addition: Warning messages:
> 1: "|" not meaningful for factors in: Ops.factor(Grass, Grid)
> 2: no finite arguments to min; returning Inf
> 3: no finite arguments to max; returning -Inf
>
> Other than adding xlim arguments, what else can I do, especially in
> light of warning message 1?
>
> Thank you in advance.
>
> Sincerely,
> Jim Milks
Are you confusing "plot.formula" with "lattice:xyplot"? Your example
should work if you use:
library(lattice)
xyplot(Microtus.T ~ Grass | Grid)
HTH,
--sundar
More information about the R-help
mailing list