# cast from POINT to LINESTRING
g <- st_sfc(st_point(1:2), st_point(c(2, 4)))
time <- Sys.time()
x <-
st_sftime(a = 3:4, g, time = time) %>%
dplyr::group_by(time) %>%
dplyr::summarize(do_union = TRUE) %>%
st_cast(to = "LINESTRING")
Run the code above in your browser using DataLab