Learn R Programming

EGAnet (version 1.2.3)

compare.EGA.plots: Visually Compares EGAnet plots

Description

Organizes EGA plots for comparison. Ensures that nodes are placed in the same layout to maximize comparison. Community memberships are also homogenized across EGA outputs to enhance interpretation

Usage

compare.EGA.plots(
  ...,
  input.list = NULL,
  base.plot = 1,
  labels,
  rows,
  columns,
  plot.args = list()
)

Value

Visual comparison of EGAnet objects

Arguments

...

EGAnet objects

input.list

List. Bypasses ... argument in favor of using a list as an input

base.plot

Numeric. Plot to be used as the base for the configuration of the networks. Uses the number of the order in which the plots are input. Defaults to 1 or the first plot

labels

Character vector. Labels for each EGAnet object

rows

Numeric. Number of rows to spread plots across

columns

Numeric. Number of columns to spread plots down

plot.args

List. A list of additional arguments for the network plot. For plot.type = "qgraph":

  • vsize Size of the nodes. Defaults to 6.

(see ggnet2 for full list of arguments):

  • vsize Size of the nodes. Defaults to 6.

  • label.size Size of the labels. Defaults to 5.

  • alpha The level of transparency of the nodes, which might be a single value or a vector of values. Defaults to 0.7.

  • edge.alpha The level of transparency of the edges, which might be a single value or a vector of values. Defaults to 0.4.

  • legend.names A vector with names for each dimension

  • color.palette The color palette for the nodes. For custom colors, enter HEX codes for each dimension in a vector. See color_palette_EGA for more details and examples

Author

Alexander Christensen <alexpaulchristensen@gmail.com>

Examples

Run this code
# Obtain SAPA items
items <- psychTools::spi[,c(11:20)]

# Draw random samples
sample1 <- items[sample(1:nrow(items), 1000),]
sample2 <- items[sample(1:nrow(items), 1000),]

if (FALSE) {
# Estimate EGAs
ega1 <- EGA(sample1)
ega2 <- EGA(sample2)

# Compare EGAs via plot
compare.EGA.plots(
  ega1, ega2,
  base.plot = 1, # use "ega1" as base for comparison
  labels = c("Sample 1", "Sample 2"),
  rows = 1, columns = 2
)}

Run the code above in your browser using DataLab