Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Only run rnet_group() examples when igraph installed #566

Merged
merged 1 commit into from
Aug 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions R/rnet_group.R
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,13 @@
#' rnet_group representing the groups of each network element. In the latter
#' case, the connectivity of the spatial object is derived from the sfNetwork
#' object.
#'
#' @note These functions rely on the igraph package. If igraph is not installed,
#' the function will return a message.
#'
#' @family rnet
#' @examples
#' if (requireNamespace("igraph", quietly = TRUE)) {
#' rnet <- rnet_breakup_vertices(stplanr::osm_net_example)
#' rnet$group <- rnet_group(rnet)
#' plot(rnet["group"])
Expand All @@ -36,6 +40,7 @@
#' plot(rnet["group_louvain"])
#' rnet$group_fast_greedy <- rnet_group(rnet, igraph::cluster_fast_greedy)
#' plot(rnet["group_fast_greedy"])
#' }
#' @export
rnet_group <- function(rnet, ...) {
UseMethod("rnet_group")
Expand Down
6 changes: 6 additions & 0 deletions man/rnet_group.Rd

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

Loading