Description Usage Arguments Details Value See Also Examples

View source: R/prepare_SETSe_binary.R

This function prepares a binary network for SETSe projection.

1 2 3 4 5 6 7 8 9 | ```
prepare_SETSe_binary(
g,
node_names,
k = NULL,
force_var,
positive_value,
sum_to_one = TRUE,
distance = 1
)
``` |

`g` |
an igraph object |

`node_names` |
a character string. A vertex attribute which contains the node names. |

`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. |

`force_var` |
A node attribute. This is used as the force variable, it must be a character of factor |

`positive_value` |
The value in force var that will be counted as the positive value |

`sum_to_one` |
Logical. whether the total positive force sums to 1, if FALSE the total is the sum of the positive cases |

`distance` |
a positive numeric value. The default is 1 |

The network takes in an igraph object and produces an undirected igraph object that can be used with SETSe/SETSe_auto/SETSe_bicomp for embedding.

The function adds the node attribute 'force' and the edge attribute 'k' unless k=NULL. The purpose of the function is to easily be able to project binary networks using SETSe.

The function creates several variables

force: a vertex attribute representing the force produced by each node. The sum of this variable will be 0

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

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

A network with the correct edge and node attributes for the embeddings process.

`SETSe`

, `SETSe_auto`

, `SETSe_bicomp`

, `prepare_SETSe_continuous`

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 the network for a binary embedding
prepare_SETSe_binary(., node_names = "name", k = 1000,
force_var = "class",
positive_value = "A") %>%
#embed the network using auto setse
SETSe_auto()
``` |

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.