ufs (version 0.3.2)

CIM: Conceptual Independence Matrix

Description

Conceptual Independence Matrix

Usage

CIM(
  data,
  scales,
  conf.level = 0.95,
  colors = c("#440154FF", "#7AD151FF"),
  outputFile = NULL,
  outputWidth = 100,
  outputHeight = 100,
  outputUnits = "cm",
  faMethod = "minres",
  n.iter = 100,
  n.repeatOnWarning = 50,
  warningTolerance = 2,
  silentRepeatOnWarning = FALSE,
  showWarnings = FALSE,
  skipRegex = NULL,
  headingLevel = 2,
  printAbbreviations = TRUE,
  drawPlot = TRUE,
  returnPlotOnly = TRUE
)

# S3 method for CIM knit_print( x, headingLevel = x$input$headingLevel, quiet = TRUE, echoPartial = FALSE, partialFile = NULL, ... )

Arguments

data

The dataframe containing the variables.

scales

The scales: a named list of character vectors, where the character vectors specify the variable names, and the names of each character vector specifies the relevant scale.

conf.level

The confidence level for the confidence intervals.

colors

The colors used for the factors. The default uses the discrete viridis() palette, which is optimized for perceptual uniformity, maintaining its properties when printed in grayscale, and designed for colourblind readers. A vector can also be supplied; the colors must be valid arguments to colorRamp() (and therefore, to col2rgb()).

outputFile

The file to write the output to.

outputWidth, outputHeight, outputUnits

The width, height, and units for the output file.

faMethod

The method to pass on to psych::fa().

n.iter

The number of iterations to pass on to psych::fa().

n.repeatOnWarning

How often to repeat on warnings (in the hopes of getting a run without warnings).

warningTolerance

How many warnings are accepted.

silentRepeatOnWarning

Whether to be chatty or silent when repeating after warnings.

showWarnings

Whether to show the warnings.

skipRegex

A character vector of length 2 containing two regular expressions; if the two scales both match one or both of those regular expressions, that cell is skipped.

headingLevel

The level for the heading; especially useful when knitting an Rmd partial.

printAbbreviations

Whether to print a table with the abbreviations that are used.

drawPlot

Whether to draw the plot or only return it.

returnPlotOnly

Whether to return the plot only, or the entire object.

x

The object to print.

quiet

Whether to be quiet or chatty.

echoPartial

Whether to echo the code in the Rmd partial.

partialFile

Can be used to override the Rmd partial file.

...

Additional arguments are passed on the respective default methods.

Value

A ggplot2::ggplot() plot.

Examples

Run this code
# NOT RUN {
### Load dataset `bfi`, originally from psychTools package
data(bfi, package= 'ufs');

### Specify scales
bfiScales <-
  list(Agreeableness     = paste0("Agreeableness_item_", 1:5),
       Conscientiousness = paste0("Conscientiousness_item_", 1:5),
       Extraversion      = paste0("Extraversion_item_", 1:5),
       Neuroticism       = paste0("Neuroticism_item_", 1:5),
       Openness          = paste0("Openness_item_", 1:5));

names(bfi) <- c(unlist(bfiScales),
                c('gender', 'education', 'age'));

### Only select first two and the first three items to
### keep it quick; just pass the full 'bfiScales'
### object to run for all five the full scales
# }
# NOT RUN {
CIM(bfi,
    scales=lapply(bfiScales, head, 3)[1:2],
    n.iter=10);
# }

Run the code above in your browser using DataCamp Workspace