get_edges_df: Get data frame of edges and weights of one or two networks

View source: R/get_edges_df.R

get_edges_dfR Documentation

Get data frame of edges and weights of one or two networks

Description

Get data frame of edges and weights of one or two networks

Usage

get_edges_df(net1, net2 = NULL, method = "union", labels = NULL)

Arguments

net1

a network. Should be either the product of qgraph or quickNet.

net2

alternative. a network. Should be either the product of qgraph or quickNet.

method

only works when net2 is provided.

  • "union": return the edges that exist in net1 or net2, default.

  • "intersect": return the edges that both exist in net1 and net2.

labels

the name of each node. If provided, the nodes will be named by labels.

Value

a data frame with 3 columns. The vectors in from and to represent the node index.

Examples


data("mtcars")
net1 <- quickNet(mtcars)
net2 <- quickNet(mtcars^3)
edges1 <- get_edges_df(net1)
edges2 <- get_edges_df(net1, net2, method = 'intersect')


LeiGuo0812/quickNet documentation built on May 1, 2024, 10:42 p.m.