prepare_SETSe_continuous: Prepare continuous network

Description Usage Arguments Details Value See Also Examples

View source: R/prepare_SETSe_continuous.R

Description

This function prepares a continuous network for SETSe projection.

Usage

1
2
3
4
5
6
7
8
prepare_SETSe_continuous(
  g,
  node_names,
  k = NULL,
  force_var,
  sum_to_one = TRUE,
  distance = 1
)

Arguments

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 numeric or integer value, it cannot have NA's

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

Details

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

The function subtracts the mean from all the values so that the system is balanced. If sum_to_one is true then everything is divided by the absolute sum over two

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 continuous networks using SETSe.

The function creates several variables

Value

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

See Also

SETSe, SETSe_auto, prepare_SETSe_binary

Examples

1
2
3
4
5
6
7
8
embeddings <- biconnected_network %>%
#prepare the network for a binary embedding
#k is already present in the data so is left null in the preparation function
prepare_SETSe_continuous(., node_names = "name", k = NULL, 
                        force_var = "force") %>%
#embed the network using auto setse
#in the biconnected_network dataset the edge weights are used directly as k values
SETSe_auto(k = "weight")

rsetse documentation built on Nov. 12, 2020, 5:08 p.m.