File: attributes.md

package info (click to toggle)
r-cran-igraph 2.2.2-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 27,772 kB
  • sloc: ansic: 206,420; cpp: 21,827; fortran: 4,090; yacc: 1,229; lex: 518; sh: 52; makefile: 8
file content (72 lines) | stat: -rw-r--r-- 1,512 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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
# error messages work

    Code
      set_vertex_attr(g, "test", value = c(1, 2))
    Condition
      Error in `i_set_vertex_attr()`:
      ! Length of new attribute value must be 1 or 5, the number of target vertices, not 2.

---

    Code
      set_edge_attr(g, "test", value = c(1, 2))
    Condition
      Error in `i_set_edge_attr()`:
      ! Length of new attribute value must be 1 or 10, the number of target edges, not 2.

---

    Code
      delete_graph_attr(g, "a")
    Condition
      Error in `delete_graph_attr()`:
      ! No graph attribute `a` found.

---

    Code
      delete_vertex_attr(g, "a")
    Condition
      Error in `delete_vertex_attr()`:
      ! No vertex attribute `a` found.

---

    Code
      delete_edge_attr(g, "a")
    Condition
      Error in `delete_edge_attr()`:
      ! No edge attribute `a` found.

---

    Code
      assert_named_list("a")
    Condition
      Error in `assert_named_list()`:
      ! `value` must be a named list with unique names

---

    Code
      assert_named_list(list("a", "b"))
    Condition
      Error in `assert_named_list()`:
      ! `value` must be a named list with unique names

# good error message when not using character

    Code
      set_graph_attr(ring, 1, 1)
    Condition
      Error in `set_graph_attr()`:
      ! `name` must be a single string, not the number 1.

# set_vertex_attrs() works

    Code
      set_vertex_attrs(g)
    Condition
      Error in `set_vertex_attrs()`:
      ! All arguments in `...` must be named.