Re: [R] contour plot, failing to interpolate through all data

From: Dieter Menne <>
Date: Wed, 05 Nov 2008 07:44:27 +0000 (UTC)

Folkes, Michael <Michael.Folkes <at>> writes:

> I'm having trouble making contour lines for this attached, sparse
> dataset (low data:NA ratio!). Is it the high number of NA's, or funny
> layout of the densities, or something else that's causing this?
> ####start data to be in file='testmatrix.csv'
> "0.5","1","1.5","2","2.5","3"
> "-0.833",NA,NA,NA,NA,NA,21.05
> "-0.8",NA,NA,NA,NA,10.62,NA
> "-0.75",NA,NA,NA,5.13,NA,NA
> "-0.667",NA,NA,2.24,NA,NA,11.68

contour needs a more data, it's rather a plotting workhorse and not so good for interpolation.
There are examples for spatial statistics in library/MASS/scripts/ch15.R and in "the book" by Venables/Ripley. You might also search for "geo" in the packages, because your problem is fairly common in geographical ecology.

Dieter mailing list PLEASE do read the posting guide and provide commented, minimal, self-contained, reproducible code. Received on Wed 05 Nov 2008 - 07:46:59 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Wed 05 Nov 2008 - 10:30:22 GMT.

Mailing list information is available at Please read the posting guide before posting to the list.

list of date sections of archive