g <- st_sfc(st_point(c(1, 2)), st_point(c(1, 3)), st_point(c(2, 3)),
st_point(c(2, 1)), st_point(c(3, 1)))
tc <- Sys.time() + 1:5
x1 <- st_sftime(a = 1:5, g, time = tc)
x2 <- st_buffer(x1, dist = 1)
## intersection
# only x provided (no y)
plot(st_intersection(x2))
# with arguments x and y provided
plot(st_intersection(x2, x1))
## difference
# only x provided (no y)
plot(st_difference(x2))
# with arguments x and y provided
plot(st_difference(x2, x1))
## symmetric difference
plot(st_sym_difference(x1, x2))
Run the code above in your browser using DataLab