swh:1:snp:fa0506d5baad169781b03c1a771c3aed2b2099f2
Tip revision: 8c77e01f2c4004fb8464b42ec3e75b79b32e9b3f authored by Doug Nychka on 16 October 2012, 18:52:38 UTC
version 6.7
version 6.7
Tip revision: 8c77e01
make.surface.grid.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
"make.surface.grid" <- function(grid.list) {
#
# the old fields version of make.surface.grid was complicated
# and we believe rarely used.
# this current function
# is essentially a single line replacement
#
# but adds an attribute for the grid matrix to carry
# and carries along the names of the grid.list variables.
# along the information as to how it was created.
# see as.surface
temp <- as.matrix(expand.grid(grid.list))
# wipe out row names
dimnames(temp) <- list(NULL, names(grid.list))
# set attribute
attr(temp, "grid.list") <- grid.list
temp
}