overlap.network: Plots the overlap of multiple conditions as bipartite network

View source: R/overlap_network.R

overlap.networkR Documentation

Plots the overlap of multiple conditions as bipartite network

Description

The function takes multiple netfacs objects and plots how different elements connect the conditions, based on the conditional probabilities that the element occurs in the condition and that the condition is seen when the element is present

Usage

overlap.network(
  netfacs.list,
  min.prob = 0,
  min.count = 5,
  significance = 0.01,
  specificity = 0.1,
  ignore.element = NULL,
  clusters = FALSE,
  plot.bubbles = FALSE
)

Arguments

netfacs.list

list of objects resulting from netfacs or multiple.netfacs

min.prob

minimum conditional probability that should be shown in the graph

min.count

minimum number of times that a combination should occur before being included in the graph

significance

sets the level of significance that combinations have to pass before added to the network

specificity

for the 'reduced' graph, select only elements that surpass this context specificity value

ignore.element

string vector, can be used to exclude certain elements when creating the plots

clusters

boolean; if TRUE, the cluster_fast_greedy algorithm is used to detect underlying community structure, based on the occurrence probability network

plot.bubbles

if TRUE, then the nodes in the network plots will be surrounded by bubbles; if FALSE, the edges connect the names directly

Value

Function returns a ggraph plot where each condition is connected to those elements that occur significantly in this condition, and each element is connected to each condition under which it occurs significantly more than expected. Creates four graphs: context specificity, occurrence in that context, a combined graph, and a 'reduced' graph where edges are only included if they pass the 'specificity' value set by the user

Examples

data(emotions_set)
emo.faces <- multiple.netfacs(
  data = emotions_set[[1]],
  condition = emotions_set[[2]]$emotion,
  ran.trials = 10,
  combination.size = 2
)

overlap <- overlap.network(emo.faces,
  min.prob = 0.01,
  min.count = 3,
  significance = 0.01,
  specificity = 0.5,
  ignore.element = "25",
  clusters = TRUE,
  plot.bubbles = TRUE
)

NetFACS documentation built on March 18, 2022, 7:40 p.m.