This function helps prepare the network edges for embedding

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

Examples

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")