Description Usage Arguments Value Note See Also Examples
The function transforms an 'sp' object to an 'RFsp' object.
This explicit transformation is only necessary if several variables and repeated measurements are given.
1 |
sp |
an ‘sp’ object |
param |
|
sp2RF
returns an object of class
RFsp
.
The two options varnames
and coordnames
,
cf. section ‘coords’ in RFoptions
,
might be useful.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | RFoptions(seed=0) ## *ANY* simulation will have the random seed 0; set
## RFoptions(seed=NA) to make them all random again
p <- 100
n <- 5
x <- runif(p, 0, 1)
y <- runif(p, 0, 1)
z <- RFsimulate(RMexp(), x=x, y=y, n=n)
z1 <- z2 <- as.data.frame(z)
coordinates(z2) <- ~coords.x1 + coords.x2
(emp.var <- RFvariogram(data=z))
(emp.var1 <- RFvariogram(data=z1))
(emp.var2 <- RFvariogram(data=sp2RF(z2, param=list(n=n, vdim=1))))
stopifnot(all.equal(emp.var, emp.var1))
stopifnot(all.equal(emp.var, emp.var2))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.