[R] overlay xyplot on contourplot in lattice in R

From: Kathy-Andrée Laplante-Albert <Kathy-Andree.Laplante-Albert_at_UQTR.CA>
Date: Mon 29 Jan 2007 - 19:34:21 GMT

Hi everybody,

I want to do a contourplot in lattice with my raw data overlaid on it(xyplot) which seemed to be a very easy thing to do.

I've tried it in many ways, but I haven't succeeded at obtaining it.

let's say x, y, and z as the variables that comes from the data frame ''ex'':

therefore my countourplot is as followed :

contourplot(z ~ x * y, cuts=550)

I would like then to overalay on it xx and yy (same variables as x and y but in another data frame let's say ''example'')

xyplot(example$xx, example$yy)

How can I do it?

It seems I could do it with the panel.contourplot and panel.xyplot options, but until now I haven't suceeded. I found this command that maybe could help me :

 # contourplot
contourplot(elev ~ longitude * latitude, data = interpgrid,

   panel = function(x, y, subscripts, ...) {

      panel.contourplot(x, y, subscripts, ...)
      panel.xyplot(ortann$longitude, ortann$latitude)
   } )

however, doesn't seem to work out, and I do not know what should I write for subscripts. I do not understand the explanation in R.

Is anyone could help me?

Thanks a lot in advance!

I use R, version 2.4.0.

Kathy-Andrée Laplante-Albert
Étudiante à la maîtrise
Groupe de Recherche sur les Écosystèmes Aquatiques Université du Québec à Trois-Rivières
C.P. 500, Trois-Rivières (Québec) Canada



Courriel expédié via
https://courriel.uqtr.ca

R-help@stat.math.ethz.ch 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. Received on Tue Jan 30 06:45:41 2007

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Mon 29 Jan 2007 - 20:30:42 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.