From 96144032c905656be67833ec3451319c0cff264b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ma=C3=ABlle=20Salmon?= Date: Tue, 10 Dec 2024 13:21:30 +0100 Subject: [PATCH 1/3] docs: better describe output of `all_shortest_paths()` --- R/structural.properties.R | 10 ++++++++-- man/distances.Rd | 10 ++++++++-- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/R/structural.properties.R b/R/structural.properties.R index ca1029e1420..353d867cdf6 100644 --- a/R/structural.properties.R +++ b/R/structural.properties.R @@ -788,10 +788,16 @@ degree_distribution <- function(graph, cumulative = FALSE, ...) { #' was not requested.} \item{inbound_edges}{Numeric vector, the inbound edge #' for each vertex, or `NULL`, if it was not requested.} #' -#' For `all_shortest_paths()` a list is returned, each list element +#' For `all_shortest_paths()` a list is returned: +#' \item{vpaths}{This is a list. Each list element #' contains a shortest path from `from` to a vertex in `to`. The #' shortest paths to the same vertex are collected into consecutive elements -#' of the list. +#' of the list.} +#' \item{epaths}{This is a list similar to vpaths, +#' but the vectors of the list contain the edge ids along the shortest paths, +#' instead of the vertex ids.} +#' \item{nrgeo}{Number of geodesics.} +#' \item{res}{} #' #' For `mean_distance()` a single number is returned if `details=FALSE`, #' or a named list with two entries: `res` is the mean distance as a numeric diff --git a/man/distances.Rd b/man/distances.Rd index 36a86e62ddf..b110e61b91e 100644 --- a/man/distances.Rd +++ b/man/distances.Rd @@ -144,10 +144,16 @@ predecessor of each vertex in the \code{to} argument, or \code{NULL} if it was not requested.} \item{inbound_edges}{Numeric vector, the inbound edge for each vertex, or \code{NULL}, if it was not requested.} -For \code{all_shortest_paths()} a list is returned, each list element +For \code{all_shortest_paths()} a list is returned: +\item{vpaths}{This is a list. Each list element contains a shortest path from \code{from} to a vertex in \code{to}. The shortest paths to the same vertex are collected into consecutive elements -of the list. +of the list.} +\item{epaths}{This is a list similar to vpaths, +but the vectors of the list contain the edge ids along the shortest paths, +instead of the vertex ids.} +\item{nrgeo}{Number of geodesics.} +\item{res}{} For \code{mean_distance()} a single number is returned if \code{details=FALSE}, or a named list with two entries: \code{res} is the mean distance as a numeric From 391981a158870eb4da41df7b6f537e446d4ab971 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ma=C3=ABlle=20Salmon?= Date: Thu, 13 Feb 2025 12:21:49 +0100 Subject: [PATCH 2/3] rephrase --- R/structural.properties.R | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/R/structural.properties.R b/R/structural.properties.R index 353d867cdf6..505dcc948a5 100644 --- a/R/structural.properties.R +++ b/R/structural.properties.R @@ -790,9 +790,9 @@ degree_distribution <- function(graph, cumulative = FALSE, ...) { #' #' For `all_shortest_paths()` a list is returned: #' \item{vpaths}{This is a list. Each list element -#' contains a shortest path from `from` to a vertex in `to`. The -#' shortest paths to the same vertex are collected into consecutive elements -#' of the list.} +#' contains the vertices of a shortest path from `from` to a vertex in `to`. +#' The shortest paths to the same vertex are collected +#' into consecutive elements of the list.} #' \item{epaths}{This is a list similar to vpaths, #' but the vectors of the list contain the edge ids along the shortest paths, #' instead of the vertex ids.} From 21ea08863c6cba8680c5f1b6d53611d859e30875 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ma=C3=ABlle=20Salmon?= Date: Thu, 13 Feb 2025 12:32:06 +0100 Subject: [PATCH 3/3] doc --- R/structural.properties.R | 5 +++-- man/closeness.Rd | 2 +- man/distances.Rd | 11 ++++++----- 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/R/structural.properties.R b/R/structural.properties.R index 505dcc948a5..9e8b77f753e 100644 --- a/R/structural.properties.R +++ b/R/structural.properties.R @@ -796,8 +796,9 @@ degree_distribution <- function(graph, cumulative = FALSE, ...) { #' \item{epaths}{This is a list similar to vpaths, #' but the vectors of the list contain the edge ids along the shortest paths, #' instead of the vertex ids.} -#' \item{nrgeo}{Number of geodesics.} -#' \item{res}{} +#' \item{nrgeo}{A vector in which each element is the number of shortest paths +#' (geodesics) from `from` to the corresponding vertex in `to`.} +#' \item{res}{Deprecated} #' #' For `mean_distance()` a single number is returned if `details=FALSE`, #' or a named list with two entries: `res` is the mean distance as a numeric diff --git a/man/closeness.Rd b/man/closeness.Rd index 0502a7f28f3..dc860d003ed 100644 --- a/man/closeness.Rd +++ b/man/closeness.Rd @@ -43,7 +43,7 @@ Numeric vector with the closeness values of all the vertices in \code{v}. } \description{ -Closeness centrality measures how many steps is required to access every other +Closeness centrality measures how many steps are required to access every other vertex from a given vertex. } \details{ diff --git a/man/distances.Rd b/man/distances.Rd index b110e61b91e..6fa25b81e6c 100644 --- a/man/distances.Rd +++ b/man/distances.Rd @@ -146,14 +146,15 @@ for each vertex, or \code{NULL}, if it was not requested.} For \code{all_shortest_paths()} a list is returned: \item{vpaths}{This is a list. Each list element -contains a shortest path from \code{from} to a vertex in \code{to}. The -shortest paths to the same vertex are collected into consecutive elements -of the list.} +contains the vertices of a shortest path from \code{from} to a vertex in \code{to}. +The shortest paths to the same vertex are collected +into consecutive elements of the list.} \item{epaths}{This is a list similar to vpaths, but the vectors of the list contain the edge ids along the shortest paths, instead of the vertex ids.} -\item{nrgeo}{Number of geodesics.} -\item{res}{} +\item{nrgeo}{A vector in which each element is the number of shortest paths +(geodesics) from \code{from} to the corresponding vertex in \code{to}.} +\item{res}{Deprecated} For \code{mean_distance()} a single number is returned if \code{details=FALSE}, or a named list with two entries: \code{res} is the mean distance as a numeric