Skip to content

Commit

Permalink
usethis::use_package_doc() - package help
Browse files Browse the repository at this point in the history
For #32
  • Loading branch information
Robinlovelace committed Aug 17, 2021
1 parent 129801e commit 018d2d6
Show file tree
Hide file tree
Showing 5 changed files with 91 additions and 17 deletions.
15 changes: 8 additions & 7 deletions R/plot_slope.R
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,18 @@
#' @param fill Should the profile be filled? `TRUE` by default
#' @param horiz Should the legend be horizontal (`FALSE` by default)
#' @param pal Color palette to use, `colorspace::diverging_hcl` by default.
#' @param x Keyword, one of "bottomright", "bottom",
#' "bottomleft", "left", "topleft", "top", "topright", "right" and "center"
#' @param legend_position The legend position. One of "bottomright", "bottom",
#' "bottomleft", "left", "topleft", "top" (the default), "topright", "right"
#' and "center".
#' @param col Line colour, black by default
#' @param cex Legend size, 0.9 by default
#' @param bg Legend background colour, `grDevices::rgb(1, 1, 1, 0.8)` by default.
#' @param title Title of the legend
#' @param title Title of the legend, `NULL` by default.
#' @param brks Breaks in colour palette to show.
#' `c(1, 3, 6, 10, 20, 40, 100)` by default.
#' @param seq_brks Sequence of breaks to show in legend.
#' Includes negative numbers and omits zero by default
#' @param ncol Number of columns in legend
#' @param ncol Number of columns in legend, 4 by default.
#' @param ... Additional parameters to pass to legend
#' @inheritParams slope_raster
#' @inheritParams sequential_dist
Expand All @@ -33,7 +34,7 @@ plot_slope = function(
fill = TRUE,
horiz = FALSE,
pal =colorspace::diverging_hcl,
x = "top",
legend_position = "top",
col = "black",
cex = 0.9,
bg = grDevices::rgb(1, 1, 1, 0.8),
Expand Down Expand Up @@ -65,7 +66,7 @@ plot_dz = function(
horiz = FALSE,
pal = colorspace::diverging_hcl,
...,
x = "top",
legend_position = "top",
col = "black",
cex = 0.9,
bg = grDevices::rgb(1, 1, 1, 0.8),
Expand All @@ -91,7 +92,7 @@ plot_dz = function(
graphics::lines(d, z, col = col, lwd = 2)
if(is.null(seq_brks)) seq_brks = seq(from = 3, to = length(b) - 2)
s = c(seq_brks[-(length(seq_brks) / 2) -1], max(seq_brks) + 1)
graphics::legend(x = x, legend = b[s] * 100, fill = pal[s],
graphics::legend(x = legend_position, legend = b[s] * 100, fill = pal[s],
..., bg = bg, title = title, horiz = horiz,
ncol = ncol, cex = cex)
}
Expand Down
27 changes: 27 additions & 0 deletions R/slopes-package.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#' @title slopes: Calculate Slopes of Roads, Rivers and Trajectories
#'
#' @description Calculate the slope (also known as steepness and gradient)
#' of linear features such as roads, rivers and ski routes.
#'
#' Created by Robin Lovelace and Rosa Félix, who developed the package
#' to support their research in active travel, and the prioritisation of
#' investment in cycling, an activity which is sensitive to slopes,
#' in particular.
#'
#' See [github.com/ITSLeeds/slopes](https://github.com/ITSLeeds/slopes/)
#' for the source code and [itsleeds.github.io/slopes](https://itsleeds.github.io/slopes/)
#' for the website.
#'
#' All package functions can be found in the
#' [Reference page](https://itsleeds.github.io/slopes/reference/index.html)
#' on the package website.
#'

#' @keywords internal
"_PACKAGE"

# The following block is used by usethis to automatically manage
# roxygen namespace tags. Modify with care!
## usethis namespace: start
## usethis namespace: end
NULL
11 changes: 6 additions & 5 deletions man/plot_dz.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 6 additions & 5 deletions man/plot_slope.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

44 changes: 44 additions & 0 deletions man/slopes-package.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 018d2d6

Please sign in to comment.