Learn R Programming

rang (version 0.3.0)

convert_edgelist: Convert Data Structures to rang edgelist

Description

This generic function converts several data structures provided by rang into an edgelist of package dependencies.

Usage

convert_edgelist(x, ...)

# S3 method for default convert_edgelist(x, ...)

# S3 method for ranglet convert_edgelist(x, ...)

# S3 method for rang convert_edgelist(x, ...)

Value

a data frame of directed edges of dependencies

Arguments

x,

supported data structures are rang and ranglet S3 objects

...,

not used

Details

the resulting data frame can be converted to an igraph object for plotting and analysis via the function igraph::graph_from_data_frame()

Examples

Run this code
# \donttest{
if (interactive()) {
    graph <- resolve(pkgs = c("openNLP", "LDAvis", "topicmodels", "quanteda"),
                snapshot_date = "2020-01-16")
                
    # dependency edgelist of a single package
    convert_edgelist(graph$ranglets[[1]])
    
    # full dependency edgelist
    convert_edgelist(graph)
}
# }

Run the code above in your browser using DataLab