sp2Geo | R Documentation |
Extracting information from an sp or spacetime object
sp2Geo(spobj,spdata = NULL)
spobj |
An object of class sp or spacetime |
spdata |
Character: The name of data in the sp or spacetime object |
The function accepts as input a sp or spacetime object and the name of the data of interest in the object and it returns a list with some useful informations for Geomodels functions.
A list with spatio-temporal informations
Moreno Bevilacqua, moreno.bevilacqua89@gmail.com,https://sites.google.com/view/moreno-bevilacqua/home, Víctor Morales Oñate, victor.morales@uv.cl, https://sites.google.com/site/moralesonatevictor/, Christian", Caamaño-Carrillo, chcaaman@ubiobio.cl,https://www.researchgate.net/profile/Christian-Caamano
# Define the spatial-coordinates of the points:
set.seed(3)
N <- 30 # number of location sites
x <- runif(N, 0, 1)
set.seed(6)
y <- runif(N, 0, 1)
coords <- cbind(x,y)
# Define spatial matrix covariates and regression parameters
X <- cbind(rep(1,N),runif(N))
# Define spatial matrix dependent variable
Y <- rnorm(nrow(X))
obj1 <- sp::SpatialPoints(coords)
obj2 <- sp::SpatialPointsDataFrame(coords,data = data.frame(X,Y))
# sp2Geo info extraction
b <- sp2Geo(obj2,spdata = "Y")
class(b)
b
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.