Skip to content

Commit

Permalink
Merge pull request #87 from statnet/i86-get.inducedSubgraph-generic
Browse files Browse the repository at this point in the history
Made get.inducedSubgraph() generic.
  • Loading branch information
CarterButts authored Oct 8, 2024
2 parents c1b2084 + 33145a5 commit 1b63f33
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 2 deletions.
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.

0 comments on commit 1b63f33

Please sign in to comment.