SpatialPointsDataFrame
from the RFspatialPointsDataFrame
or
conventional2RFspDataFrame
or by calls of the form
as(x, "RFspatialPointsDataFrame")
, where x
is of class
SpatialPointsDataFrame
,
directly.
Class SpatialPoints
, by class
SpatialPointsDataFrame
.
Class Spatial
,
by class SpatialPoints
.data
-slot, each colums is ordered according to the
ordering of coordinates(grid)
, the first dimension runs fastest
and for all BUT the second dimension, coordinate values are in
ascending order. In the second dimension, coordinate values run from
high to low. Hence, when converting to conventional formats using
as.matrix
does not perform re-ordering. Methods
RFspatialGridDataFrame-class
, which is for point
locations that are on a grid,
RFpointsDataFrame-class
which is for one-dimensional
locations,
RFsp
RFoptions(seed=0) ## *ANY* simulation will have the random seed 0; set
## RFoptions(seed=NA) to make them all random again
x <- cbind(runif(50), runif(50))
f <- RFsimulate(model=RMexp(), x=x, n=3)
str(f)
str(RFspDataFrame2conventional(f))
coordinates(f)[1:25,]
str(f[2]) ## selects second column of data-slot
all.equal(f, cbind(f,f)[1:3]) ## TRUE
try(as(f, "RFspatialGridDataFrame")) # yields error
plot(f, nmax=2)
f2 <- RFsimulate(model=RMwhittle(nu=1.2, scale=10), x=cbind(x,x), n=4)
plot(f2, MARGIN=c(3,4), nmax=2)
f.sp <- RFsimulate(model=RMexp(), x=x, n=3, seed=0)
f.old <- RFsimulate(model=RMexp(), x=x, n=3, spConform=FALSE, seed=0)
all.equal(RFspDataFrame2conventional(f.sp)$data, f.old) ## TRUE
FinalizeExample()
Run the code above in your browser using DataLab