R/measure_attributes.R
measure_attributes_nodes.RdThese functions extract certain attributes from network data:
node_attribute() returns an attribute's values for the nodes in a network.
node_names() returns the names of the nodes in a network.
node_is_mode() returns the mode of the nodes in a network.
These functions are also often used as helpers within other functions.
node_*() always return vectors the same length
as the number of nodes in the network.
node_attribute(.data, attribute)
node_names(.data)
node_is_mode(.data)An object of a manynet-consistent class:
matrix (adjacency or incidence) from {base} R
edgelist, a data frame from {base} R or tibble from {tibble}
igraph, from the {igraph} package
network, from the {network} package
tbl_graph, from the {tidygraph} package
Character string naming an attribute in the object.
Other measures:
measure_attributes_ties,
measure_central_between,
measure_central_close,
measure_central_degree,
measure_central_eigen,
measure_closure,
measure_cohesion,
measure_diffusion_infection,
measure_diffusion_net,
measure_diffusion_node,
measure_features,
measure_heterogeneity,
measure_hierarchy,
measure_holes,
measure_periods,
measure_properties,
member_diffusion
node_attribute(fict_lotr, "Race")
#> [1] "Human" "Human" "Hobbit" "Elf" "Human" "Elf" "Elf" "Human"
#> [9] "Human" "Hobbit" "Elf" "Maiar" "Dwarf" "Elf" "Hobbit" "Hobbit"
#> [17] "Hobbit" "Hobbit" "Maiar" "Human" "Maiar" "Elf" "Ent" "Human"
#> [25] "Maiar" "Human" "Elf" "Human" "Elf" "Human" "Elf" "Elf"
#> [33] "Hobbit" "Human" "Maiar" "Human"
node_names(ison_southern_women)
#> [1] "Evelyn" "Laura" "Theresa" "Brenda" "Charlotte" "Frances"
#> [7] "Eleanor" "Pearl" "Ruth" "Verne" "Myra" "Katherine"
#> [13] "Sylvia" "Nora" "Helen" "Dorothy" "Olivia" "Flora"
#> [19] "E1" "E2" "E3" "E4" "E5" "E6"
#> [25] "E7" "E8" "E9" "E10" "E11" "E12"
#> [31] "E13" "E14"
node_is_mode(ison_southern_women)
#> Evelyn Laura Theresa Brenda Charlotte Frances Eleanor Pearl Ruth Verne Myra
#> 1 FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE
#> # ... and 7 more values from this nodeset. Use `print_all(...)` to print all values.
#> E1 E2 E3 E4 E5 E6 E7 E8 E9 E10 E11 E12 E13
#> 1 TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE
#> # ... and 1 more values from this nodeset. Use `print_all(...)` to print all values.