loon (version 1.3.3)

completegraph: Create a complete graph or digraph with a set of nodes

Description

From Wikipedia: "a complete graph is a simple undirected graph in which every pair of distinct vertices is connected by a unique edge. A complete digraph is a directed graph in which every pair of distinct vertices is connected by a pair of unique edges (one in each direction

Usage

completegraph(nodes, isDirected = FALSE)

Arguments

nodes

a character vector with node names, each element defines a node hence the elements need to be unique

isDirected

a boolean scalar to indicate wheter the returned object is a complete graph (undirected) or a complete digraph (directed).

Value

graph object of class loongraph

Details

Note that this function masks the completegraph function of the graph package. Hence it is a good idead to specify the package namespace with ::, i.e. loon::completegraph and graph::completegraph.

For more information run: l_help("learn_R_display_graph.html.html#graph-utilities")

Examples

Run this code
# NOT RUN {
g <- loon::completegraph(letters[1:5])
# }

Run the code above in your browser using DataCamp Workspace