File: aaa.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 (35 lines) | stat: -rw-r--r-- 751 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
#' @importFrom igraph graph_attr graph_attr<-
`%gr_attr%` <- function(e1, e2) {
  graph_attr(e1) <- graph_attr(e2)
  attributes(e1) <- attributes(e2)
  e1
}

as_ind <- function(i, length) {
  seq_len(length)[i]
}

#' @importFrom igraph gorder
as_node_ind <- function(i, graph) {
  if (!missing(i)) {
    i <- with_graph(unfocus(graph), {{i}})
  }
  as_ind(i, gorder(graph))
}

compress_rank <- function(x) {
  match(x, sort(x))
}

expect_influencer <- function(...) {
  rlang::check_installed('influenceR', ...)
}
expect_netrankr <- function(...) {
  rlang::check_installed('netrankr', ...)
}
expect_seriation <- function(...) {
  rlang::check_installed('seriation', ...)
}
expect_netswan <- function(...) {
  rlang::check_installed('NetSwan', ...)
}