swath_stats | R Documentation |
Statistics of the elevation data across a swath profile.
swath_stats(x, profile.length = NULL)
x |
list. The return object of |
profile.length |
numeric or |
tibble
swath_profile()
# Create a random raster
r <- terra::rast(ncol = 10, nrow = 10, xmin = -150, xmax = -80, ymin = 20, ymax = 60)
terra::values(r) <- runif(terra::ncell(r))
# Create a random profile
profile <- data.frame(lon = c(-140, -90), lat = c(55, 25)) |>
sf::st_as_sf(coords = c("lon", "lat"), crs = "WGS84")
swath <- swath_profile(profile, r, k = 5, dist = 10)
swath_stats(swath, profile.length = profile_length(profile_line(profile)))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.