File: igraph.R

package info (click to toggle)
r-cran-tidygraph 1.3.1-2
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 880 kB
  • sloc: cpp: 41; sh: 13; makefile: 2
file content (17 lines) | stat: -rw-r--r-- 400 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#' @describeIn tbl_graph Method for igraph object. Simply subclasses the object into a `tbl_graph`
#' @export
as_tbl_graph.igraph <- function(x, ...) {
  class(x) <- c('tbl_graph', 'igraph')
  attr(x, 'active') <- 'nodes'
  x
}

#' @importFrom igraph as.igraph
#' @export
as.igraph.tbl_graph <- function(x, ...) {
  class(x) <- 'igraph'
  attr(x, 'active') <- NULL
  x
}
#' @export
igraph::as.igraph