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

Made get.inducedSubgraph() generic. #87

Merged
merged 1 commit into from
Oct 8, 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
1 change: 1 addition & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ S3method(get.edge.attribute,list)
S3method(get.edge.attribute,network)
S3method(get.edge.value,list)
S3method(get.edge.value,network)
S3method(get.inducedSubgraph,network)
S3method(get.network.attribute,network)
S3method(get.vertex.attribute,network)
S3method(is.bipartite,mixingmatrix)
Expand Down
10 changes: 9 additions & 1 deletion R/access.R
Original file line number Diff line number Diff line change
Expand Up @@ -906,6 +906,8 @@ get.dyads.eids<-function(x,tails,heads,neighborhood = c("out", "in", "combined")
#' @param eid optionally, a numeric vector of valid edge ids in \code{x} that
#' should be retained (cannot be used with \code{v} or \code{alter})
#'
#' @param ... additional arguments for methods.
#'
#' @return A \code{\link{network}} object containing the induced subgraph.
#' @author Carter T. Butts \email{buttsc@@uci.edu}
#' @seealso \code{\link{network}}, \code{\link{network.extraction}}
Expand Down Expand Up @@ -936,7 +938,13 @@ get.dyads.eids<-function(x,tails,heads,neighborhood = c("out", "in", "combined")
#'
#'
#' @export get.inducedSubgraph
get.inducedSubgraph<-function(x, v, alters=NULL, eid=NULL){
get.inducedSubgraph <- function(x, ...) {
UseMethod("get.inducedSubgraph")
}

#' @rdname get.inducedSubgraph
#' @export
get.inducedSubgraph.network <- function(x, v, alters=NULL, eid=NULL, ...){
#Check to be sure we were called with a network
if(!is.network(x))
stop("get.inducedSubgraph requires an argument of class network.")
Expand Down
7 changes: 6 additions & 1 deletion man/get.inducedSubgraph.Rd

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