Skip to content
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
12 changes: 10 additions & 2 deletions R/structural.properties.R
Original file line number Diff line number Diff line change
Expand Up @@ -1130,6 +1130,7 @@ ego_size <- function(graph, order = 1, nodes = V(graph),
#'
#' These functions find the vertices not farther than a given limit from
#' another fixed vertex, these are called the neighborhood of the vertex.
#' Note that `ego()` and `neighborhood()` are synonyms, aliases.
#'
#' The neighborhood of a given order `r` of a vertex `v` includes all
#' vertices which are closer to `v` than the order. I.e. order 0 is always
Expand All @@ -1139,7 +1140,7 @@ ego_size <- function(graph, order = 1, nodes = V(graph),
#' `ego_size()` returns the size of the neighborhoods of the given order,
#' for each given vertex.
#'
#' `ego()` returns the vertices belonging to the neighborhoods of the given
#' `ego()`/`neighborhood()` (synonyms) returns the vertices belonging to the neighborhoods of the given
#' order, for each given vertex.
#'
#' `make_ego_graph()` is creates (sub)graphs from all neighborhoods of
Expand All @@ -1165,7 +1166,7 @@ ego_size <- function(graph, order = 1, nodes = V(graph),
#' @return
#' \itemize{
#' \item{`ego_size()` returns with an integer vector.}
#' \item{`ego()` returns A list of `igraph.vs` or a list of numeric
#' \item{`ego()`/`neighborhood()` (synonyms) returns A list of `igraph.vs` or a list of numeric
#' vectors depending on the value of `igraph_opt("return.vs.es")`,
#' see details for performance characteristics.}
#' \item{`make_ego_graph()` returns with a list of graphs.}
Expand All @@ -1185,6 +1186,10 @@ ego_size <- function(graph, order = 1, nodes = V(graph),
#' ego(g, order = 0, 1:3)
#' ego(g, order = 1, 1:3)
#' ego(g, order = 2, 1:3)
#' # neighborhood() is an alias of ego()
#' neighborhood(g, order = 0, 1:3)
#' neighborhood(g, order = 1, 1:3)
#' neighborhood(g, order = 2, 1:3)
#'
#' # attributes are preserved
#' V(g)$name <- c("a", "b", "c", "d", "e", "f", "g", "h", "i", "j")
Expand Down Expand Up @@ -1220,6 +1225,9 @@ ego <- function(graph, order = 1, nodes = V(graph),
res
}

#' @export
#' @rdname ego
neighborhood <- ego
#' @rdname ego
#' @family structural.properties
#' @export
Expand Down
2 changes: 0 additions & 2 deletions R/zzz-deprecate.R
Original file line number Diff line number Diff line change
Expand Up @@ -447,8 +447,6 @@ deprecated("mod.matrix", modularity_matrix)
#' @export multilevel.community
deprecated("multilevel.community", cluster_louvain)

#' @export neighborhood
deprecated("neighborhood", ego)
#' @export neighborhood.size
deprecated("neighborhood.size", ego_size)
#' @export no.clusters
Expand Down
17 changes: 15 additions & 2 deletions man/ego.Rd

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