Convert networks to graph objects
## S3 method for class 'nma_data' as.igraph(x, ..., collapse = TRUE) ## S3 method for class 'nma_data' as_tbl_graph(x, ...)
x |
An nma_data object to convert |
... |
Additional arguments |
collapse |
Logical, collapse edges over studies? Default |
An igraph object for as.igraph(), a tbl_graph object for
as_tbl_graph().
# Set up network of smoking cessation data
head(smoking)
smk_net <- set_agd_arm(smoking,
study = studyn,
trt = trtc,
r = r,
n = n,
trt_ref = "No intervention")
# Print details
smk_net
# Convert to igraph object
igraph::as.igraph(smk_net) # Edges combined by default
igraph::as.igraph(smk_net, collapse = FALSE) # Without combining edges
# Convert to tbl_graph object
tidygraph::as_tbl_graph(smk_net) # Edges combined by default
tidygraph::as_tbl_graph(smk_net, collapse = FALSE) # Without combining edgesPlease choose more modern alternatives, such as Google Chrome or Mozilla Firefox.