https://github.com/cran/fields
Tip revision: a82f141190b29d59547a12b9a44a7e2d1af8fb60 authored by Doug Nychka on 05 January 2007, 21:27:53 UTC
version 3.3.1
version 3.3.1
Tip revision: a82f141
quilt.plot.R
"quilt.plot" <-
function(x,y,z,nrow=64, ncol=64, grid=NULL, add.legend=TRUE,...){
x<- as.matrix(x)
if( ncol(x)==2){
z<- y}
if( ncol(x)==1){
x<- cbind( x,y)}
if( ncol(x)==3){
z<- x[,3]
x<- x[,1:2]
}
# at this point x should be a 2 column matrix of x-y locations
# z is a vector or one column matrix of the z values.
#discretize data
as.image( z, x=x, nrow=nrow, ncol=ncol, na.rm=TRUE)-> out.p
#plot it
if( add.legend){
image.plot( out.p,col=tim.colors(64),...)
}
else{
image(out.p, col=tim.colors(64),...)
}
}