normalize_sgmwcs_instance: Helper function to convert an 'igraph' object into a proper...

View source: R/signal_solvers.R

normalize_sgmwcs_instanceR Documentation

Helper function to convert an igraph object into a proper SGMWCS instance

Description

This function generates new igraph object with additional signals field added. The way the instance is constructed is defined by the function parameters. Nodes and edges are grouped separately, grouping columns are defined by nodes.group.by and edges.group.by arguments. group.only.positive param specifies whether to group only positive-weighted (specified by nodes/edges.weight.column) nodes and edges.

Usage

normalize_sgmwcs_instance(
  g,
  nodes.weight.column = "weight",
  edges.weight.column = "weight",
  nodes.group.by = "signal",
  edges.group.by = "signal",
  group.only.positive = TRUE
)

Arguments

g

Graph to convert

nodes.weight.column

Nodes column name (e.g. weight, score, w) for scoring

edges.weight.column

Edges column name for scoring

nodes.group.by

Nodes grouping column (e.g. signal, group, class)

edges.group.by

Edges grouping column

group.only.positive

Whether to group only positive-scored nodes/edges#'

Value

An igraph object with proper attributes set.

Examples

data("gatom_example")
normalize_sgmwcs_instance(gatom_example)


mwcsr documentation built on Sept. 11, 2024, 7:49 p.m.