network_conditional: Create a network based on conditional probabilities of dyads...

View source: R/network_conditional.R

network_conditionalR Documentation

Create a network based on conditional probabilities of dyads of elements

Description

This is a convenience function to create and visualize a network of conditional probabilities for all dyadic element combinations of a netfacs object. Conditional probabilities are calculated using the conditional_probabilities function.

Usage

network_conditional(
  netfacs.data,
  min.prob = 0,
  min.count = 0,
  ignore.element = NULL,
  plot.bubbles = TRUE
)

Arguments

netfacs.data

object resulting from netfacs or conditional_probabilities functions.

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

ignore.element

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

plot.bubbles

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

Value

Function returns named list that includes a tbl_graph network and a ggraph plot.

See Also

netfacs, conditional_probabilities

Examples

### how do angry facial expressions differ from non-angry ones?
data(emotions_set)
angry.face <- netfacs(
  data = emotions_set[[1]],
  condition = emotions_set[[2]]$emotion,
  test.condition = "anger",
  ran.trials = 100,
  combination.size = 2
)

conditional.probs <- conditional_probabilities(angry.face)

network_conditional(
  netfacs.data = conditional.probs,
  min.prob = 0.01,
  min.count = 3,
  ignore.element = "25",
  plot.bubbles = FALSE
)

NetFACS documentation built on Dec. 7, 2022, 1:12 a.m.