[R] simulate spatial data
Daniel Malter
daniel at umd.edu
Thu Dec 11 22:12:16 CET 2008
Hi, I am simulating 2-dimensional data using the RandomFields library and
the gaussRF function therein. While this is done with the code below, I
would like the landscape to be continuous or smooth at the edges. That is, I
would like the upper edge to smoothly connect to the lower edge AND the
right edge to smoothly connect to the left edge. I cannot figure out how to
do this. I would greatly appreciate pointers to the right function, a
different package, or any other viable approach.
Best,
Daniel
library(RandomFields)
PrintModelList() ## the complete list of implemented models
model <- "stable"
mean <- 0
variance <- 10
nugget <- 0 #noise around the structure
scale <- 10 #structure/patchiness
alpha <- 2 ## see help("CovarianceFct") for additional
## parameters of the covariance functions
step <- 1 ## nicer, but also time consuming if step <- 0.1
x <- seq(0, 100, step)
y <- seq(0, 100, step)
f <- GaussRF(x=x, y=y, model=model,grid=T, param=c(mean, variance, nugget,
scale, alpha)) #
par(mfcol=c(1,2))
image(x, y, f)
contour(f)
-------------------------
cuncta stricte discussurus
More information about the R-help
mailing list