points <- matrix(c(10, 5, 25, 15, 5, 25), ncol = 2, byrow = TRUE)
extract_lsm(landscape, y = points)
extract_lsm(landscape, y = points, type = "aggregation metric")
points_sp <- sp::SpatialPoints(points)
extract_lsm(landscape, y = points_sp, what = "lsm_p_area")
if (FALSE) {
# use lines
x1 <- c(1, 5, 15, 10)
y1 <- c(1, 5, 15, 25)
x2 <- c(10, 25)
y2 <- c(5, 5)
sample_lines <- sp::SpatialLines(list(sp::Lines(list(sp::Line(cbind(x1, y1)),
sp::Line(cbind(x2, y2))), ID = "a")))
extract_lsm(landscape, y = sample_lines, what = "lsm_p_area")
}
Run the code above in your browser using DataLab