From e47fc28404bc494d1578280586fb38b3bee59270 Mon Sep 17 00:00:00 2001 From: mpadge Date: Sun, 12 Sep 2021 10:49:56 +0200 Subject: [PATCH] improve docs of dists_proportional for #144 --- R/dists-proportional.R | 8 ++++++-- man/dodgr_dists_proportional.Rd | 9 +++++++-- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/R/dists-proportional.R b/R/dists-proportional.R index b3c381d83..707813ae0 100644 --- a/R/dists-proportional.R +++ b/R/dists-proportional.R @@ -3,12 +3,16 @@ #' @inheritParams dodgr_dists #' @param graph `data.frame` or equivalent object representing the network #' graph which must have a column named "edge_type" with integer types along -#' which proportional distances are to be aggregated. The value of "edge_type" = -#' 0 is the default type for which proportional distances are not aggregated. +#' which proportional distances are to be aggregated (see Note). #' @return A list of distance matrices of equal dimensions (length(from), #' length(to)), the first of which ("distance") holds the final distances, while #' the rest are one matrix for each unique value of "edge_type", holding the #' distances traversed along those types of edges only. +#' +#' @note The "edge_type" column in the graph must be labelled with sequential +#' integer values: The first type should have a value of 1; the second a value +#' of 2; and so on. Values of 0 can be used to flag "default" edges for which +#' distances are not to be aggregated. #' @export dodgr_dists_proportional <- function (graph, from = NULL, diff --git a/man/dodgr_dists_proportional.Rd b/man/dodgr_dists_proportional.Rd index bb4cf0ad9..3a392f01b 100644 --- a/man/dodgr_dists_proportional.Rd +++ b/man/dodgr_dists_proportional.Rd @@ -15,8 +15,7 @@ dodgr_dists_proportional( \arguments{ \item{graph}{\code{data.frame} or equivalent object representing the network graph which must have a column named "edge_type" with integer types along -which proportional distances are to be aggregated. The value of "edge_type" = -0 is the default type for which proportional distances are not aggregated.} +which proportional distances are to be aggregated (see Note).} \item{from}{Vector or matrix of points \strong{from} which route distances are to be calculated (see Notes)} @@ -39,3 +38,9 @@ distances traversed along those types of edges only. \description{ Proportional distances along different edge categories } +\note{ +The "edge_type" column in the graph must be labelled with sequential +integer values: The first type should have a value of 1; the second a value +of 2; and so on. Values of 0 can be used to flag "default" edges for which +distances are not to be aggregated. +}