View source: R/graph_edit_distance.R
| load.graph.data | R Documentation |
Loads pruned graph data from a series of RDA files for different k values and combines them into a list structure containing adjacency and distance lists.
load.graph.data(
k.values,
prefix,
suffix = "_NN_graph.rda",
graph.object.name = "S.graph",
verbose = TRUE
)
k.values |
Numeric vector of k values to process. Must be positive integers. |
prefix |
Character string specifying the path and prefix of the RDA files. |
suffix |
Character string specifying the suffix of the RDA files (default: "_NN_graph.rda"). |
graph.object.name |
Character string specifying the name of the graph object stored in the RDA files (default: "S.graph"). |
verbose |
Logical indicating whether to show progress messages (default: TRUE). |
The function expects RDA files to be named according to the pattern:
paste0(prefix, k, suffix) for each k value.
Each RDA file should contain an object with the name specified in
graph.object.name, which must have components pruned_adj_list
and pruned_dist_list.
A list containing two components:
adj.list |
Named list of adjacency lists, one for each k value |
dist.list |
Named list of distance lists, one for each k value |
prefix <- file.path(tempdir(), "dgraphs-k")
S.graph <- list(
pruned_adj_list = list(c(2L), c(1L)),
pruned_dist_list = list(1, 1)
)
save(S.graph, file = paste0(prefix, 2, ".rda"))
graph.data <- load.graph.data(
2, prefix = prefix, suffix = ".rda", verbose = FALSE
)
unlink(paste0(prefix, 2, ".rda"))
names(graph.data$adj.list)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.