Skip to content

slopes

2.0.0Package record

Calculate Slopes of Roads, Rivers and Trajectories

0packages depend
2.4Kdownloads / year
70.9%test coverage
13/13flavors OK

Overview

About

Calculates the slope (longitudinal gradient or steepness) of linear geographic features such as roads (for more details, see Ariza-López et al. (2019) doi:10.1038/s41597-019-0147-x) and rivers (for more details, see Cohen et al. (2018) doi:10.1016/j.jhydrol.2018.06.066). It can use local Digital Elevation Model (DEM) data or download DEM data via the 'ceramic' package. The package also provides functions to add elevation data to linestrings and visualize elevation profiles.

Changes in 2.0.0
  • Migrated from the deprecated raster package to terra (closes #60). terra is now a hard dependency (Imports); raster is no longer required or suggested.
  • elevation_extract(), slope_raster(), and elevation_add() now always use terra. The terra = argument is deprecated (with a message) and ignored.
  • elevation_get() now always returns a SpatRaster. The output_format = argument is deprecated and ignored.
  • slope_matrix_to_raster() and slope_xyz_simple() now work with SpatRaster objects. Legacy Raster* objects are accepted with an automatic conversion message for backwards compatibility.
  • The bundled dataset has been renamed from dem_lisbon_raster to dem_lisbon and is now a SpatRaster object (was a RasterLayer).
  • Fixed CRAN --run-donttest failure: the ceramic/Mapbox-dependent example in elevation_add() is now wrapped in \dontrun{} instead of \donttest{} (closes #72).
Show all changes in 2.0.0Hide the rest of the changes in 2.0.0
  • Fixed slopes_palette() hardcoded testing logic, allowing it to correctly return any number of requested colors for the "Green-Brown" palette.
  • Substantially improved overall package test coverage (from ~59% to over 84%) by adding test wrappers for plot functions and matrix conversion utilities.

From NEWS.md in the release

Install

Health

CRAN checks
13OK
Slowest check: 2.5 min · r-oldrel-windows-x86_64
Status changes
  • OK13 OK2026-08-04
  • NOTE12 OK, 1 NOTE2026-08-01
  • OK14 OK2026-03-10
Advisories

none known

Documentation

In release 2.0.0
READMEYes · 572 wordsVignettesYes · 5 · dynamicNEWSYes · 100% structured · mentions 2.0.0Citation fileNoWebsiteYes · pkgdown
Help pages
37
Examples that run
100%6 run in a plain check
Exported functions with examples
26%
Documented parameters
99%
Return-value docs
91%
Help pages citing references
0%

Downloads

2.4K
CRAN downloads in the past year
Rank #11,635 · ~6/day · ~196/mo
Daily download trend is not available in this view yet.
35830 days
91690 days
2.4K1 year
Compare downloads with other packages →
Also on97 r2u5 autocran

Repository

78Stars
8Forks
4Open issues
0Open PRs
3Releases
357Commits
8Commit identities
License file reads as GPL-3.0 · 357 commits · Last activity 2026-06-25 · 0% stars, 30d
Responsiveness
How these are sampled
PRs merged (all time)
93%
Median days to close, 50 most recently updated closed issues
68
Median days to close, 50 most recently updated closed PRs
0

Stars over time

2025-06-14 · 712026-09-04 · 78
PracticesBeta

15 development-tooling and community-health practices detected across 8 families in the upstream repository

Checks run against github.com/ropensci/slopes on 2026-10-11.

Continuous integration (3)
GitHub ActionsR CMD check workflowtic

The R CMD check workflow runs on Linux, macOS and Windows, and on R-devel

Governance and community (2)
Code of conductContributing guide
Docs source (3)
README.Rmdpkgdown

GitHub Pages site last deployed 2026-06-16

pkgdown site last built 2026-06-16, before release 2.0.0 (2026-06-25)

Coverage (1)
Coverage reporting (Codecov)
Show all practicesHide 4 practices
Reproducibility and dev environment (1)
data-raw/
CRAN release process (2)
cran-comments.mdCRAN-SUBMISSION
Research and citation (2)
codemeta.jsonJOSS paper
Lint, format, editor (1)
RStudio project
How this is detected·Detection ruleset v3 (2026-09-26)
AI coding toolsBeta

This repository shows signs of AI coding tools.

  • GitHub Copilotfirst seen 2026-05-28
    Pull request: opened by its own account
How this is detected·Detection ruleset v4 (updated 2026-09-27)

Dependencies

Declared dependencies
18 external dependencies (excludes base and recommended)

Installing slopes adds 13 packages (11 with compiled code, 21 MB of source tarballs). Heaviest: sf 9.3 MB, s2 2.8 MB, colorspace 2.0 MB.

Depends (1)
R >= 2.10
LinkingTo (0)
none
Enhances (0)
none
Reverse dependencies
0direct
0indirect

Nothing depends on this yet.

Datasets

People & History

People (6)
Author, Maintainer since 1.0.1 (2025), Copyright holder
Reviewer
Dan reviewed the package for rOpenSci, see https://github.com/ropensci/software-review/issues/420#issuecomment-857662657
Reviewer
Andy reviewed the package for rOpenSci, see…
Releases (3)

Pick two releases to compare their code metrics.

  • 2.0.0Latest
    record
    2026-06-25 · current release · diff ↗ ·
    added 2 exports
    slope_breaks, slope_colors
  • unarchivedReturned to CRAN
    2026-06-17
  • 1.0.2
    record
    2026-06-17 · diff ↗ ·
    removed 9 exports
    z_cumulative_difference, z_direction, z_elevation_change_start_end, z_end, z_max, z_mean, z_min, z_start, z_value
    added 6 exports
    dem_lisbon, route_to_segments, slope_matrices, slope_matrix_to_raster, slope_xyz_simple, slopes_palette
  • archivedRemoved from CRAN
    2026-05-24
    issues were not corrected in time
  • R
    R 4.6.0 released · 2026-04-24
  • 1.0.1
    record
    2025-06-23
  • R
    R 4.5.0 released · 2025-04-11

Package metadata

First published
2025-06-23
Total releases
3 / 1 yrs
License
GPL-3 OSI
Minimum R
≥ 2.10
Bundled data
109 KB / 9 files
Download size
2.1 MB

Cite

Cite this package

Run in R for the authors' preferred citation:

citation("slopes")
Lovelace, R., Félix, R., Matos, G., Olner, D., Talbot, J., & Teucher, A. (2026). slopes: Calculate Slopes of Roads, Rivers and Trajectories (Version 2.0.0) [Computer software]. https://doi.org/10.32614/CRAN.package.slopes

This package has no citation file, so citation() returns this entry built from DESCRIPTION.

Cite the R Observatory

For a number measured here: a download total, a coverage figure, an archival date.

APA

Balamuta, J. J. (2026). R Observatory: Metrics for slopes version 2.0.0 [Data set]. HJJB, LLC. Data release v2026-10-18. https://doi.org/10.5281/zenodo.21843040

From data release v2026-10-18, which the citation names so these numbers can be found later. More on citing and the projects behind them.

Report a problem with this page →

Privacy choices

These apply to this browser and are stored on this device only. Nothing about your choice is sent to us.

Read the privacy policy