Given an sf data frame with geometry types POLYGON, MULTIPOLYGON, or POINT representing time series locations, this function transforms the output of distantia(), distantia_ls(), distantia_dtw() or distantia_time_delay() to an sf data frame.
If network = TRUE, the sf data frame is of type LINESTRING, with edges connecting time series locations. This output is helpful to build many-to-many dissimilarity maps (see examples).
If network = FALSE, the sf data frame contains the geometry in the input sf argument. This output helps build one-to-many dissimilarity maps.
distantia_spatial(df =NULL, sf =NULL, network =TRUE)
Arguments
df: (required, data frame) Output of distantia() or distantia_time_delay(). Default: NULL
sf: (required, sf data frame) Points or polygons representing the location of the time series in argument 'df'. It must have a column with all time series names in df$x and df$y. Default: NULL
network: (optional, logical) If TRUE, the resulting sf data frame is of time LINESTRING and represent network edges. Default: TRUE