Learn R Programming

spEDM (version 1.7)

embedded: embedding spatial cross sectional data

Description

embedding spatial cross sectional data

Usage

# S4 method for sf
embedded(data, target, E = 3, tau = 1, nb = NULL, detrend = FALSE)

# S4 method for SpatRaster embedded(data, target, E = 3, tau = 1, detrend = FALSE)

Value

A matrix

Arguments

data

observation data.

target

name of target variable.

E

(optional) embedding dimensions.

tau

(optional) step of spatial lags.

nb

(optional) neighbours list.

detrend

(optional) whether to remove the linear trend.

Examples

Run this code
columbus = sf::read_sf(system.file("case/columbus.gpkg", package="spEDM"))
v = embedded(columbus,"crime")
v[1:5,]

cu = terra::rast(system.file("case/cu.tif", package="spEDM"))
r = embedded(cu,"cu")
r[1:5,]

Run the code above in your browser using DataLab