data_all {sfclust} | R Documentation |
Prepare data in long format
Description
Convert spatio-temporal data to long format with indices for time and spatial location.
Usage
data_all(stdata, stnames = c("geometry", "time"))
Arguments
stdata |
A stars object containing spatial-temporal dimensions defined in |
stnames |
The names of the |
Value
A long-format data frame with ids for each observation and for spatial and time indexing.
Examples
library(sfclust)
library(stars)
dims <- st_dimensions(
geometry = st_sfc(lapply(1:5, function(i) st_point(c(i, i)))),
time = seq(as.Date("2024-01-01"), by = "1 day", length.out = 3)
)
stdata <- st_as_stars(cases = array(1:15, dim = c(5, 3)), dimensions = dims)
data_all(stdata)
[Package sfclust version 1.0.1 Index]