From 8ca18e0908486e24af7ea4f6b0646c9fd03ba23f Mon Sep 17 00:00:00 2001 From: mpadge Date: Fri, 27 Sep 2024 12:29:28 +0200 Subject: [PATCH] update docs for #254 --- DESCRIPTION | 2 +- R/dists.R | 21 +++++++++++++++------ codemeta.json | 2 +- man/dodgr_distances.Rd | 21 +++++++++++++++------ man/dodgr_dists.Rd | 21 +++++++++++++++------ man/dodgr_times.Rd | 21 +++++++++++++++------ 6 files changed, 62 insertions(+), 26 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index d3e33cca..e03cbed5 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: dodgr Title: Distances on Directed Graphs -Version: 0.4.1.029 +Version: 0.4.1.030 Authors@R: c( person("Mark", "Padgham", , "mark.padgham@email.com", role = c("aut", "cre")), person("Andreas", "Petutschnig", role = "aut"), diff --git a/R/dists.R b/R/dists.R index 80c675c9..1bef14db 100644 --- a/R/dists.R +++ b/R/dists.R @@ -46,12 +46,21 @@ #' combination of names will be accepted (for example, `fromx, fromy`, #' `from_x, from_y`, or `fr_lat, fr_lon`.) #' -#' `from` and `to` values can be either two-column matrices or -#' equivalent of longitude and latitude coordinates, or else single columns -#' precisely matching node numbers or names given in `graph$from` or -#' `graph$to`. If `to` is `NULL`, pairwise distances are calculated from all -#' `from` points to all other nodes in `graph`. If both `from` and `to` are -#' `NULL`, pairwise distances are calculated between all nodes in `graph`. +#' `from` and `to` parameters passed to this function can be either: +#' \itemize{ +#' \item Single character vectors precisely matching node numbers or names +#' given in `graph$from` or `graph$to`. +#' \item Single vectors of integer-ish values, in which case these will be +#' presumed to specify indices into \link{dodgr_vertices}, and NOT to +#' correspond to values in the "from" to "to" columns of the graph. +#' \item matrices or equivalent of longitude and latitude coordinates, in which +#' case these will be matched on to the nearest coordinates of "from" and "to" +#' points in the graph. +#' } +#' +#' If `to` is `NULL`, pairwise distances will be calculated from all `from` +#' points to all other nodes in `graph`. If both `from` and `to` are `NULL`, +#' pairwise distances are calculated between all nodes in `graph`. #' #' Calculations in parallel (`parallel = TRUE`) ought very generally be #' advantageous. For small graphs, calculating distances in parallel is likely diff --git a/codemeta.json b/codemeta.json index 3a054409..6090c526 100644 --- a/codemeta.json +++ b/codemeta.json @@ -11,7 +11,7 @@ "codeRepository": "https://github.com/UrbanAnalyst/dodgr", "issueTracker": "https://github.com/UrbanAnalyst/dodgr/issues", "license": "https://spdx.org/licenses/GPL-3.0", - "version": "0.4.1.029", + "version": "0.4.1.030", "programmingLanguage": { "@type": "ComputerLanguage", "name": "R", diff --git a/man/dodgr_distances.Rd b/man/dodgr_distances.Rd index 58b43fbd..bcc3ce63 100644 --- a/man/dodgr_distances.Rd +++ b/man/dodgr_distances.Rd @@ -74,12 +74,21 @@ graph vertices, or combinations to two columns specifying geographical combination of names will be accepted (for example, \verb{fromx, fromy}, \verb{from_x, from_y}, or \verb{fr_lat, fr_lon}.) -\code{from} and \code{to} values can be either two-column matrices or -equivalent of longitude and latitude coordinates, or else single columns -precisely matching node numbers or names given in \code{graph$from} or -\code{graph$to}. If \code{to} is \code{NULL}, pairwise distances are calculated from all -\code{from} points to all other nodes in \code{graph}. If both \code{from} and \code{to} are -\code{NULL}, pairwise distances are calculated between all nodes in \code{graph}. +\code{from} and \code{to} parameters passed to this function can be either: +\itemize{ +\item Single character vectors precisely matching node numbers or names +given in \code{graph$from} or \code{graph$to}. +\item Single vectors of integer-ish values, in which case these will be +presumed to specify indices into \link{dodgr_vertices}, and NOT to +correspond to values in the "from" to "to" columns of the graph. +\item matrices or equivalent of longitude and latitude coordinates, in which +case these will be matched on to the nearest coordinates of "from" and "to" +points in the graph. +} + +If \code{to} is \code{NULL}, pairwise distances will be calculated from all \code{from} +points to all other nodes in \code{graph}. If both \code{from} and \code{to} are \code{NULL}, +pairwise distances are calculated between all nodes in \code{graph}. Calculations in parallel (\code{parallel = TRUE}) ought very generally be advantageous. For small graphs, calculating distances in parallel is likely diff --git a/man/dodgr_dists.Rd b/man/dodgr_dists.Rd index f37cc82c..4fca6631 100644 --- a/man/dodgr_dists.Rd +++ b/man/dodgr_dists.Rd @@ -74,12 +74,21 @@ graph vertices, or combinations to two columns specifying geographical combination of names will be accepted (for example, \verb{fromx, fromy}, \verb{from_x, from_y}, or \verb{fr_lat, fr_lon}.) -\code{from} and \code{to} values can be either two-column matrices or -equivalent of longitude and latitude coordinates, or else single columns -precisely matching node numbers or names given in \code{graph$from} or -\code{graph$to}. If \code{to} is \code{NULL}, pairwise distances are calculated from all -\code{from} points to all other nodes in \code{graph}. If both \code{from} and \code{to} are -\code{NULL}, pairwise distances are calculated between all nodes in \code{graph}. +\code{from} and \code{to} parameters passed to this function can be either: +\itemize{ +\item Single character vectors precisely matching node numbers or names +given in \code{graph$from} or \code{graph$to}. +\item Single vectors of integer-ish values, in which case these will be +presumed to specify indices into \link{dodgr_vertices}, and NOT to +correspond to values in the "from" to "to" columns of the graph. +\item matrices or equivalent of longitude and latitude coordinates, in which +case these will be matched on to the nearest coordinates of "from" and "to" +points in the graph. +} + +If \code{to} is \code{NULL}, pairwise distances will be calculated from all \code{from} +points to all other nodes in \code{graph}. If both \code{from} and \code{to} are \code{NULL}, +pairwise distances are calculated between all nodes in \code{graph}. Calculations in parallel (\code{parallel = TRUE}) ought very generally be advantageous. For small graphs, calculating distances in parallel is likely diff --git a/man/dodgr_times.Rd b/man/dodgr_times.Rd index 4b411eaa..42e5bb34 100644 --- a/man/dodgr_times.Rd +++ b/man/dodgr_times.Rd @@ -60,12 +60,21 @@ graph vertices, or combinations to two columns specifying geographical combination of names will be accepted (for example, \verb{fromx, fromy}, \verb{from_x, from_y}, or \verb{fr_lat, fr_lon}.) -\code{from} and \code{to} values can be either two-column matrices or -equivalent of longitude and latitude coordinates, or else single columns -precisely matching node numbers or names given in \code{graph$from} or -\code{graph$to}. If \code{to} is \code{NULL}, pairwise distances are calculated from all -\code{from} points to all other nodes in \code{graph}. If both \code{from} and \code{to} are -\code{NULL}, pairwise distances are calculated between all nodes in \code{graph}. +\code{from} and \code{to} parameters passed to this function can be either: +\itemize{ +\item Single character vectors precisely matching node numbers or names +given in \code{graph$from} or \code{graph$to}. +\item Single vectors of integer-ish values, in which case these will be +presumed to specify indices into \link{dodgr_vertices}, and NOT to +correspond to values in the "from" to "to" columns of the graph. +\item matrices or equivalent of longitude and latitude coordinates, in which +case these will be matched on to the nearest coordinates of "from" and "to" +points in the graph. +} + +If \code{to} is \code{NULL}, pairwise distances will be calculated from all \code{from} +points to all other nodes in \code{graph}. If both \code{from} and \code{to} are \code{NULL}, +pairwise distances are calculated between all nodes in \code{graph}. Calculations in parallel (\code{parallel = TRUE}) ought very generally be advantageous. For small graphs, calculating distances in parallel is likely