Make a network or igraph graph object of dependencies and reverse dependencies from tibble output by functions like `get_neighborhood`, `get_all_dependents`etc

make_neighborhood_graph(ndf, type = "igraph")

Arguments

ndf

(tibble) Output by functions like `get_neighborhood`, `get_all_dependents` etc

type

(string, Default: "igraph") Graph object type. Either "network" or "igraph"

Value

A network or igraph graph object

See also

neighborhood_graph, get_neighborhood

Examples

pkggraph::init(local = TRUE)
#> Using 'local' data ...
#> To fetch data from CRAN over internet, run:
#> `pkggraph::init(local = FALSE)`
#> Done!
graph_object <- pkggraph::get_neighborhood("caret")
#> Error in get_all_dependencies(packages = packages, level = level, relation = relation, strict = strict, ignore = ignore): Unable to find `deptable`. Please run `pkggraph::init(local = TRUE)`.
pkggraph::make_neighborhood_graph(graph_object)
#> Error in inherits(ndf, "tbl_df"): object 'graph_object' not found