prepare_edges: Prepare network edges

Description Usage Arguments See Also Examples

View source: R/prepare_edges.R

Description

This function helps prepare the network edges for embedding

Usage

1
prepare_edges(g, k = NULL, distance = 1, create_edge_name = TRUE)

Arguments

g

an igraph object

k

The spring constant. This value is either a numeric value giving the spring constant for all edges or NULL. If NULL is used the k value will not be added to the network. This is useful k is made through some other process.

distance

The spring constant. This value is either a numeric value giving the spring constant for all edges or NULL. If NULL is used the distance value will not be added to the network. This is useful distance is made through some other process.

create_edge_name

Logical. Whether to create and edge name attribute or not.

@details The function prepares the edge characteristics of the network so that they can be embedded using the SETSe_ family of functions.

@return The function creates several variables

  • k: The spring constant representing the stiffness of the spring.

  • distance: The minimum distance between nodes. This is the distance between the parallel planes/hyper-planes.

  • edge_name: the name of the edges. it takes the form "from_to" where "from" is the origin node and "to" is the destination node using the as_data_frame function from igraph

See Also

setse, setse_auto, setse_bicomp, setse_auto_hd

Other prepare_setse: prepare_categorical_force(), prepare_continuous_force()

Examples

1
2
3
4
5
6
7
8
9
set.seed(234) #set the random see for generating the network
g <- generate_peels_network(type = "E")
embeddings <- g %>%
prepare_edges(k = 500, distance = 1) %>%
#prepare the network for a binary embedding
prepare_categorical_force(., node_names = "name",
                     force_var = "class") %>%
#embed the network using auto setse
  setse_auto(., force = "class_A")

rsetse documentation built on June 11, 2021, 5:07 p.m.