Learn R Programming

umx (version 1.4.0)

umx_explode_twin_names: umx_explode_twin_names

Description

Break names like Dep_T1 into a list of base names, a seperator, and a vector of twin indexes. e.g. c("Dep_T1", "Dep_T2") -> list(varnames = c("Dep"), sep = "_T", twinIndexes = c(1,2))

Usage

umx_explode_twin_names(df, sep = "_T")

Arguments

df
vector of names or data.frame containing the data
sep
text constant separating name from numeric 1:2 twin index

Value

- list(varnames = c("Dep"), sep = "_T", twinIndexes = c(1,2))

See Also

Other xmu internal not for end user: xmuHasSquareBrackets, xmuLabel_MATRIX_Model, xmuLabel_Matrix, xmuLabel_RAM_Model, xmuMI, xmuMakeDeviationThresholdsMatrices, xmuMakeOneHeadedPathsFromPathList, xmuMakeTwoHeadedPathsFromPathList, xmuMaxLevels, xmuMinLevels, xmuPropagateLabels, xmu_check_levels_identical, xmu_dot_make_paths, xmu_dot_make_residuals, xmu_start_value_list

Examples

Run this code
require(umx)
data("twinData")
umx_explode_twin_names(twinData, sep = "")
# Single-character single variable test case
x = round(10 * rnorm(1000, mean = -.2))
y = round(5 * rnorm(1000))
x[x < 0] = 0; y[y < 0] = 0
umx_explode_twin_names(data.frame(x_T1 = x, x_T2 = y), sep = "_T")
umx_explode_twin_names(data.frame(x_T11 = x, x_T22 = y), sep = "_T")

Run the code above in your browser using DataLab