## Not run:
# # Create a simple graph
# nodes <-
# create_nodes(nodes = c("a", "b", "c", "d"),
# type = "letter",
# label = TRUE,
# value = c(3.5, 2.6, 9.4, 2.7))
#
# edges <-
# create_edges(from = c("a", "b", "c"),
# to = c("d", "c", "a"),
# rel = "leading_to")
#
# graph <-
# create_graph(nodes_df = nodes,
# edges_df = edges)
#
# # Set attribute 'color = "green"' for nodes "a" and "c" using
# # the graph object
# graph <-
# set_node_attr(x = graph, nodes = c("a", "c"),
# node_attr = "color", values = "green")
#
# # Set attribute 'color = "green"' for nodes "a" and "c" using
# # the node data frame
# nodes <-
# set_node_attr(x = nodes, nodes = c("a", "c"),
# node_attr = "color", values = "green")
#
# #' # Set attribute 'color = "blue"' for all nodes
# # the node data frame
# nodes <-
# set_node_attr(x = nodes, node_attr = "color", values = "blue")
# ## End(Not run)
Run the code above in your browser using DataLab