Learn R Programming

MplusAutomation (version 1.1.1)

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)

Value

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

Arguments

cmd

A character string

Author

Michael Hallquist revised by Joshua Wiley

Details

Note that this is an internal function only.

Examples

Run this code

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

Run the code above in your browser using DataLab