Learn R Programming

umx (version 1.4.0)

umx_reorder: umx_reorder

Description

Reorder the variables in a correlation matrix. Can also remove one or more variables from a matrix using this function

Usage

umx_reorder(old, newOrder)

Arguments

old
a square matrix of correlation or covariances to reorder
newOrder
The order you'd like the variables to be in

Value

- the re-ordered (and/or resized) matrix

References

- http://www.github.com/tbates/umx

See Also

Other Data Functions: umxCovData, umxFactor, umxHetCor, umxPadAndPruneForDefVars, umx_as_numeric, umx_cont_2_quantiles, umx_cov2raw, umx_lower2full, umx_make_MR_data, umx_make_bin_cont_pair_data, umx_make_fake_data, umx_merge_CIs, umx_read_lower, umx_residualize, umx_round, umx_scale_wide_twin_data, umx_scale, umx_swap_a_block, umx

Examples

Run this code
oldMatrix = cov(mtcars)
umx_reorder(oldMatrix, newOrder = c("mpg", "cyl", "disp")) # first 3
umx_reorder(oldMatrix, newOrder = c("hp", "disp", "cyl")) # subset and reordered

Run the code above in your browser using DataLab