diff --git a/R/slopes.R b/R/slopes.R index dd96fec..35e36c9 100644 --- a/R/slopes.R +++ b/R/slopes.R @@ -222,13 +222,13 @@ slope_matrices = function(m_xyz_split, fun = slope_matrix_weighted, ...) { #' (rows representing linestrings) in the input object. #' @export #' @examples +#' library(sf) #' routes = lisbon_road_network[1:3, ] #' dem = dem_lisbon_raster #' (s = slope_raster(routes, dem)) #' cor(routes$Avg_Slope, s) #' slope_raster(routes, dem, directed = TRUE) #' # Demonstrate that reverse routes have the opposite directed slope -#' library(sf) #' slope_raster(st_reverse(routes), dem, directed = TRUE) slope_raster = function( routes, diff --git a/man/slope_raster.Rd b/man/slope_raster.Rd index 5f19a63..bd284cb 100644 --- a/man/slope_raster.Rd +++ b/man/slope_raster.Rd @@ -58,12 +58,12 @@ geometries to \code{LINESTRING}s as follows: \code{r_linestring = sf::st_cast(routes, "LINESTRING")}. } \examples{ +library(sf) routes = lisbon_road_network[1:3, ] dem = dem_lisbon_raster (s = slope_raster(routes, dem)) cor(routes$Avg_Slope, s) slope_raster(routes, dem, directed = TRUE) # Demonstrate that reverse routes have the opposite directed slope -library(sf) slope_raster(st_reverse(routes), dem, directed = TRUE) }