Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

separateHyphens

Separate Hyphenated Variable Strings


Description

This code is a simplified form of expandCmd from the lavaan package. It separates hyphenated variable strings into a list of vectors, while ignoring hyphens that may be used in numbers.

Usage

separateHyphens(cmd)

Arguments

cmd

A character string

Details

Note that this is an internal function only.

Value

The character string if no hyphens, or a list of vectors if there are hyphens.

Author(s)

Michael Hallquist revised by Joshua Wiley

Examples

MplusAutomation:::separateHyphens("x1x4")
MplusAutomation:::separateHyphens("x1-x4")
MplusAutomation:::separateHyphens("x1-x4; x1*-1; v1-v3;")

MplusAutomation

An R Package for Facilitating Large-Scale Latent Variable Analyses in Mplus

v0.8
LGPL-3
Authors
Michael Hallquist [aut, cre], Joshua Wiley [aut], Caspar van Lissa [ctb], Daniel Morillo [ctb]
Initial release
2020-09-28

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.