From eba28b706ae0a5476b946b67c5a25a7fc1591006 Mon Sep 17 00:00:00 2001 From: loreabad6 Date: Sun, 31 Jan 2021 19:28:38 +0100 Subject: [PATCH] Proof-read --- R/morphers.R | 2 +- man/st_network_cost.Rd | 4 ++-- vignettes/join_filter.Rmd | 2 +- vignettes/preprocess_and_clean.Rmd | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/R/morphers.R b/R/morphers.R index 90f951ca..1e3867fe 100644 --- a/R/morphers.R +++ b/R/morphers.R @@ -623,7 +623,7 @@ to_spatial_smooth = function(x, store_original_data = FALSE) { # --> There are two pseudo nodes that form the boundary of the set. # --> These are the ones connected to only one other pseudo node. N_b = N[degree(G) == 1] - # If these boundaries do not exists: + # If these boundaries do not exist: # --> We are dealing with a loop of connected pseudo nodes. # --> The loop is by definition not connected to the rest of the network. # --> Hence, there is no need to create a new edge. diff --git a/man/st_network_cost.Rd b/man/st_network_cost.Rd index d3bc2d15..ad6c9774 100644 --- a/man/st_network_cost.Rd +++ b/man/st_network_cost.Rd @@ -41,7 +41,7 @@ geographic edge lengths will be calculated internally and used as weights. If set to \code{NA}, no weights are used, even if the edges have a \code{weight} column.} -\item{Inf_as_NaN}{Should the cost values of unconnected nodes be stored as +\item{Inf_as_NaN}{Should the cost values of unconnected nodes be stored as \code{NaN} instead of \code{Inf}? Defaults to \code{FALSE}.} \item{...}{Arguments passed on to \code{\link[igraph]{distances}}.} @@ -65,7 +65,7 @@ By default, \code{\link[igraph]{distances}} calculates costs by by allowing to travel each edge in both directions, hence by assuming an undirected network. This is the default even when the input network is directed! For directed networks, the behaviour can be changed by setting -\code{mode = "out"} to considere only outbound edges, or \code{mode = "in"} +\code{mode = "out"} to consider only outbound edges, or \code{mode = "in"} to consider only inbound edges. } \examples{ diff --git a/vignettes/join_filter.Rmd b/vignettes/join_filter.Rmd index c08e9b2a..56dc53bc 100644 --- a/vignettes/join_filter.Rmd +++ b/vignettes/join_filter.Rmd @@ -193,7 +193,7 @@ plot(st_geometry(joined, "edges")) plot(st_as_sf(joined, "nodes"), pch = 20, add = TRUE) ``` -In the example above, the polygons are spatially distinct. Hence, each node can only intersect with a single polygon. But what would happen if we do a join with polygons that overlap? The attributes from which polygon will then be attached to a node that intersects with multiple polygons at once? In `sf` this issue is solved by duplicating such a point as much times as the number of polygons it intersects with, and attaching attributes of each intersecting polygon to one of these duplicates. This approach does not fit the network case, however. An edge can only have a single node at each of its endpoints, and thus, the duplicated nodes will be isolated an be redundant in the network structure. Therefore, `sfnetworks` will only join the information from the first match whenever there are multiple matches for a single node. A warning is given in that case such that you are aware of the fact that not all information was joined into the network. +In the example above, the polygons are spatially distinct. Hence, each node can only intersect with a single polygon. But what would happen if we do a join with polygons that overlap? The attributes from which polygon will then be attached to a node that intersects with multiple polygons at once? In `sf` this issue is solved by duplicating such a point as much times as the number of polygons it intersects with, and attaching attributes of each intersecting polygon to one of these duplicates. This approach does not fit the network case, however. An edge can only have a single node at each of its endpoints, and thus, the duplicated nodes will be isolated and will be redundant in the network structure. Therefore, `sfnetworks` will only join the information from the first match whenever there are multiple matches for a single node. A warning is given in that case such that you are aware of the fact that not all information was joined into the network. Note that in the case of joining on the edges, multiple matches per edge are not a problem for the network structure. It will simply duplicate the edge (i.e. creating a set of parallel edges) whenever this occurs. diff --git a/vignettes/preprocess_and_clean.Rmd b/vignettes/preprocess_and_clean.Rmd index 56addc1d..88ae903d 100644 --- a/vignettes/preprocess_and_clean.Rmd +++ b/vignettes/preprocess_and_clean.Rmd @@ -364,7 +364,7 @@ clustered %>% # For the others, which were used as grouping variables: # --> Drop these attributes. combinations = list( - is_priority = any, + is_priority = function(x) any(x), "ignore" )