File: test-attrmap.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 (17 lines) | stat: -rw-r--r-- 460 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
# Custom attrmap specifications -------------------------------------------

test_that("'na' vertex attribute can be dropped when going network->igraph", {
  net <- asNetwork(exIgraph)
  a <- attrmap()
  r <- data.frame(
    type="vertex", 
    fromcls="network",
    fromattr="na",
    tocls="igraph", 
    toattr=NA,
    stringsAsFactors=FALSE
  )
  aa <- rbind(a, r)
  g <- asIgraph(net, amap=aa)
  expect_false( "na" %in% igraph::vertex_attr_names(g))
} )