saveNetworkPlots | R Documentation |
Given a list of plots, write all plots to a single pdf file containing one plot per page, and optionally save the graph layout as a csv file.
saveNetworkPlots(
plotlist,
outfile,
pdf_width = 12,
pdf_height = 10,
outfile_layout = NULL,
verbose = FALSE
)
plotlist |
A named list whose elements are of class |
outfile |
A |
pdf_width |
Sets the page width. Passed to the |
pdf_height |
Sets the page height. Passed to the |
outfile_layout |
An optional |
verbose |
Logical. If |
Returns TRUE
, invisibly.
Brian Neal (Brian.Neal@ucsf.edu)
Hai Yang, Jason Cham, Brian Neal, Zenghua Fan, Tao He and Li Zhang. (2023). NAIR: Network Analysis of Immune Repertoire. Frontiers in Immunology, vol. 14. doi: 10.3389/fimmu.2023.1181825
set.seed(42)
toy_data <- simulateToyData()
net <-
generateNetworkObjects(
toy_data,
"CloneSeq"
)
net <-
addPlots(
net,
color_nodes_by =
c("SampleID", "CloneCount"),
print_plots = TRUE
)
saveNetworkPlots(
net$plots,
outfile =
file.path(tempdir(), "network.pdf"),
outfile_layout =
file.path(tempdir(), "graph_layout.txt")
)
# Load saved graph layout
graph_layout <- matrix(
scan(file.path(tempdir(), "graph_layout.txt"), quiet = TRUE),
ncol = 2
)
all.equal(graph_layout, net$plots$graph_layout)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.