I’m using the filled.contour() function to make a contour plot.
This is my (simplified) R code:
testdata <- read.csv("test.csv",header=TRUE,sep=",",fill=TRUE)
x <- as.matrix(subset(testdata,select=X))
z <- as.matrix(subset(testdata,select=c(L1,L2,L3,L4)))
filled.contour(x=x,z=z,nlevels=20)
and this my (simplified) testing data:
X,L1,L2,L3,L4
10,5,5,5,2
25,3,5,5,2
30,3,3,5,2
45,3,3,2,2
My problem is: if the data contains NA values I get ‘holes’ in my plot. How can I handle this? Values should be interpolated. I can’t find information about the function interpolation itself. So?
It’s not a direct answer to your question, but here is a good start:
http://stat.ethz.ch/R-manual/R-patched/library/stats/html/approxfun.html