input_excel: Input Excel

View source: R/input_excel.R

input_excelR Documentation

Input Excel

Description

Reads excel files containing factor loadings and latent correlations for IPV charts.

Usage

input_excel(global = NULL, tests)

Arguments

global

character; name of the excel file containing factor loadings from the global level and the test level, and latent correlations from the test level.

tests

character; name(s) of the excel file(s) containing factor loadings from the test level and the facet level, and latent correlations from the facet level.

Details

Note that the excel files need a very specific structure. Use the example files as templates.

The global argument defaults to NULL. This allows to only use the tests argument, resulting in a simple model with one test and its facets.

If you specify an element in tests as NA, this test will be treated as having no facets.

Currently, any potential xarrows need to be added manually by changing the list element xarrow in the output of this function.

Value

List containing formatted data including center distances for item_chart, facet_chart, and nested_chart.

Examples

# read data for a simple model by ignoring the "global" parameter of
# input_excel
single_file <- system.file(
  "extdata",
  "DSSEI.xlsx",
  package = "IPV",
  mustWork = TRUE)
x <- input_excel(tests = single_file)

# read data for a nested model
# the estimates need to be split into several excel files as in the example
global <- system.file(
  "extdata",
  "IPV_global.xlsx",
  package = "IPV",
  mustWork = TRUE)
tests <- c(
  system.file(
    "extdata",
    "IPV_DSSEI.xlsx",
    package = "IPV",
    mustWork = TRUE),
  system.file(
    "extdata",
    "IPV_SMTQ.xlsx",
    package = "IPV",
    mustWork = TRUE),
  system.file(
    "extdata",
    "IPV_RSES.xlsx",
    package = "IPV",
    mustWork = TRUE))
x <- input_excel(global = global, tests = tests)


IPV documentation built on Sept. 30, 2022, 5:08 p.m.