[R-sig-Geo] Use of formula in spplot function

Paul Hiemstra p.hiemstra at geo.uu.nl
Fri Aug 29 20:30:57 CEST 2008


Paulo van Breugel schreef:
> Dear all,
>
> I am exploring the options of plotting data using the sp package. It 
> is, after some trial and error, not too difficult to produce nice 
> looking maps combining polygon, line and grid data with spplot. One 
> thing I haven't been able to figure out though is the use of the 
> argument 'formula' in the spplot.grid function. Does anyone has a good 
> example explaining its use?
>
> Best regards
>
> Paulo van Breugel
>
> _______________________________________________
> R-sig-Geo mailing list
> R-sig-Geo at stat.math.ethz.ch
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
Hi,

I've been using spplot a lot over the past two years and I've never used 
the formula argument. Why do you want to use it? If you are determined 
to use it, the documentation of spplot says :

formula     optional; may be useful to plot a transformed value. 
Defaults to z~x+y for single and z~x+y|name for multiple attributes; use 
e.g. exp(x)~x+y|name to plot the exponent of the z-variable

Why the formula argument looks like this can be traced back to the fact 
that the lattice function levelplot is used to make the plots. See 
?levelplot for extra information (see the x argument).

cheers and good luck!
Paul

-- 
Drs. Paul Hiemstra
Department of Physical Geography
Faculty of Geosciences
University of Utrecht
Heidelberglaan 2
P.O. Box 80.115
3508 TC Utrecht
Phone:     +31302535773
Fax:    +31302531145
http://intamap.geo.uu.nl/~paul




More information about the R-sig-Geo mailing list