data.prepare | R Documentation |
Function for data preparation for RFSI and STRK functions. It transforms data to a data.frame.
data.prepare(data,
data.staid.x.y.z=NULL,
obs.col=NULL,
s.crs=NA
)
data |
sf-class, sftime-class, SpatVector-class, SpatRaster-class or data.frame; Contains target variable (observations) and covariates. If data.frame object, it should have next columns: station ID (staid), longitude (x), latitude (y), 3rd component - time, depth, ... (z) of the observation, and observation value (obs). |
data.staid.x.y.z |
numeric or character vector; Positions or names of the station ID (staid), longitude (x), latitude (y) and 3rd component (z) columns in data.frame object (e.g. c(1,2,3,4)). If |
obs.col |
numeric or character; Column name or number showing position of the observation column in the |
s.crs |
st_crs or crs; Source CRS of |
A list with the following elements:
data.df |
A data.frame obtained from |
data.staid.x.y.z |
Positions of the station ID (staid), longitude (x), latitude (y) and 3rd component (z) columns in data.frame object (e.g. c(1,2,3,4)). |
s.crs |
Source CRS of |
obs.col |
Column number showing position of the observation column in the |
Aleksandar Sekulic asekulic@grf.bg.ac.rs
Sekulić, A., Kilibarda, M., Heuvelink, G. B., Nikolić, M. & Bajat, B. Random Forest Spatial Interpolation. Remote. Sens. 12, 1687, https://doi.org/10.3390/rs12101687 (2020).
near.obs
rfsi
tune.rfsi
cv.rfsi
library(sf)
library(meteo)
library(sp)
# prepare data
demo(meuse, echo=FALSE)
meuse <- meuse[complete.cases(meuse@data),]
data = st_as_sf(meuse, coords = c("x", "y"), crs = 28992, agr = "constant")
data.df <- data.prepare(data,
obs.col="zinc")
str(data.df)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.