https://github.com/cran/fields
Raw File
Tip revision: 6c8b30169bba182a68765ee3cb9b4e2ef7d38332 authored by Doug Nychka on 16 November 2011, 00:00:00 UTC
version 6.6.3
Tip revision: 6c8b301
plot.vgram.matrix.r
# fields, Tools for spatial data
# Copyright 2004-2011, Institute for Mathematics Applied Geosciences
# University Corporation for Atmospheric Research
# Licensed under the GPL -- www.gpl.org/licenses/gpl.html
"plot.vgram.matrix" <- function(x, ...) {
    ind <- x$ind
    ir <- range(ind[, 1])
    jr <- range(ind[, 2])
    # x and y grid values
    temp.list <- list(x = (ir[1]:ir[2]) * x$dx, y = (jr[1]:jr[2]) * 
        x$dy)
    # fill in a matrix with variogram values
    ind2 <- cbind(ind[, 1] - min(ind[, 1]) + 1, ind[, 2] - min(ind[, 
        2]) + 1)
    temp <- matrix(NA, nrow = max(ind2[, 1]), ncol = max(ind2[, 
        2]))
    temp[ind2] <- x$vgram.full
    temp.list$z <- temp
    # plot it!
    image.plot(temp.list, ...)
}
back to top