set.seed(0)
n <- 3
x <- GridTopology(cellcentre.offset=c(0, 0),
cellsize=c(1, 0.2),
cells.dim=c(10, 30))
f <- RFsimulate(model=RMexp(), x=x, n=n)
str(f)
str(RFspDataFrame2conventional(f))
str(RFspDataFrame2dataArray(f))
coordinates(f)[1:25,]
str(f[2]) ## selects second column of data-slot
all.equal(f, cbind(f,f)[1:3]) ## TRUE
str(as(f, "RFspatialPointsDataFrame"))
plot(f, nmax=2)
steps <- if (interactive()) c(10, 1, 10, 10) else c(2, 1, 2, 2)
x2 <- rbind(c(0, 0, 0, 0),
c(1, 0.2, 2, 5),
steps)
scale <- if (interactive()) 10 else 1
f2 <- RFsimulate(model=RMwhittle(nu=1.2, scale=scale), x=x2, grid=TRUE, n=n)
plot(f2, MARGIN=c(3,4), MARGIN.slices=1, n.slices=6, nmax=2)
set.seed(123)
f.sp <- RFsimulate(model=RMexp(), x=x, n=n)
set.seed(123)
f.old <- RFsimulate(model=RMexp(), x=x, n=n, spConform=FALSE)
all.equal(RFspDataFrame2conventional(f.sp)$data, f.old) ## TRUE
Run the code above in your browser using DataLab