File: s3common.R

package info (click to toggle)
r-cran-intergraph 2.0-4-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 392 kB
  • sloc: sh: 13; makefile: 2
file content (37 lines) | stat: -rw-r--r-- 699 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37

#============================================================================ 
# common functions

igVcount <- function(x, ...) UseMethod("igVcount")

#' @export
igVcount.igraph <- function(x, ...)
  igraph::vcount(x)

#' @export
igVcount.network <- function(x, ...)
  network::network.size(x)

igEcount <- function(x, ...) UseMethod("igEcount")

#' @export
igEcount.igraph <- function(x, ...)
  igraph::ecount(x)

#' @export
igEcount.network <- function(x, ...)
  network::network.edgecount(x)

igDirected <- function(x) UseMethod("igDirected")

#' @export
igDirected.igraph <- function(x) {
  igraph::is_directed(x)
}

#' @export
igDirected.network <- function(x) {
  network::is.directed(x)
}