[R] Fitting Contour to Data Points

From: Laura Quinn <laura_at_env.leeds.ac.uk>
Date: Mon 16 May 2005 - 20:17:14 EST


Apologies for the mass mailing today!

I am attempting to produce a contour plot for phsical data on a map matrix. I have a small number of data points which each has an (x,y) co-ordinate together with a corresponding value which I would like to cvreate a contour plot for.

I have tried the following code:

contour(data$x,data$y,data$value)

but am told:

Error in contour.default(data$x, data$y, data$value) :

        increasing x and y values expected

I have re-ordered the matrix so that the x values are increasing, but these do not necessarrily correspond with increasing y values (as this is not a regular grid)...can anyone offer a way around this??

Laura Quinn
Institute of Atmospheric Science
School of Earth and Environment
University of Leeds
Leeds
LS2 9JT

tel: +44 113 343 1596
fax: +44 113 343 6716
mail: laura@env.leeds.ac.uk



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 Received on Mon May 16 20:35:22 2005

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:31:46 EST