bifactory_template: Open or Copy the bifactory Analysis Template

View source: R/template.R

bifactory_templateR Documentation

Open or Copy the bifactory Analysis Template

Description

Opens the shipped analysis template in your editor, or copies it to a destination of your choice. The template walks through the full bifactory pipeline (CFA / ESEM / B-ESEM comparison, reliability, ESEM-within-CFA, factor scores, and optional multi-group invariance) using psych::bfi as the demo dataset.

Usage

bifactory_template(to = NULL, overwrite = FALSE)

Arguments

to

Optional file path. If supplied, the template is copied there (with overwrite protection). If NULL (default), the template is opened in the editor via file.edit.

overwrite

Logical. Overwrite an existing file at to? Default FALSE.

Value

Invisibly returns the path to the template (or the destination when to is supplied).

Examples

# Find the template path
system.file("templates", "template.R", package = "bifactory")

# Copy the template to a file (here a temporary one)
dest <- file.path(tempdir(), "my_analysis.R")
bifactory_template(to = dest, overwrite = TRUE)

## Not run: 
# Open the template directly in your editor (interactive session only)
bifactory_template()

## End(Not run)


bifactory documentation built on Oct. 28, 2026, 1:06 a.m.