Skip to content
Prev 651 / 29559 Next

mapping contours

On Tue, 1 Nov 2005, Jeanne Thibeault wrote:

            
Assuming that you have a base map of some kind plotted already, you can 
use the add=TRUE argument to contour() to overplot with contours. There is 
no function in R to construct contours from irregularly placed points, you 
have to use interp() from tha akima package first (or some other 
interpolator - Tps in the fields package is a good alternative if you like 
splines), and go on from there.

If you need the actual lines, you can get them using contourLines(), and 
plot them afterwards - in contour(), they are never returned to the user. 
But to get contours, you need a regular grid first. If you need to, you 
can mask the regular grid with NA values, which contour() and 
contourLines() will respect.

Hope this helps,

Roger

PS.

Showing an informative excerpt of the code you've already tried may get 
you a more focussed response. Since this is climate data, the fields 
package may already have things you can use.