Skip to content

about contour - get contour coordinates - exclude area display

2 messages · Patrick Giraudoux, Brian Ripley

#
Dear all,

I wonder about what could actually be possible with the function "contour":

1/ - the definition of contour lines is most often meaningless when the contours are drawn in areas where no real data points exist.
It can however happen that irregular distributions lead to more or less  irregular clouds of data points. Interpolations (eg: loess
regression, GLM, etc...) are however generally made on regular grids passed to the function contour and thus can cover areas with
no/few data points to some extent. It would be most useful to display the contours with a polygon argument allowing the exclusion of
those areas (this is possible, for instance, with controur.krige of the package GeoR).  Is there a way to exclude the display of
contour lines out of polygon coordinates passed to the contour function (or another function in a package doing this) ?

2/ - it would also be most useful to get the contour lines coordinates (for instance, for importation in a GIS). Is there a way to
get them?

Thanks in advance for any hint,

Patrick Giraudoux
#
On Sat, 31 Jan 2004, Patrick Giraudoux wrote:

            
There is no function cont(r)our.krige in geoR. There is a function
`contour.kriging', and that just calls contour, so you too can do whatever
you think that does (and the help page does not tally with your
description).
Contour works on a rectangular grid.  Set to NA those cells where you have
no data, and you will not get contours there.  Simple!
Paul Murrell has fulfilled that request a while back.  See the clines
package on CRAN, or contourLines in the development version of R.