umx_reorder | R Documentation |
Reorder the variables in a correlation matrix. Can also remove one or more variables from a matrix using this function.
umx_reorder(old, newOrder, force = FALSE)
old |
a square matrix of correlation or covariances to reorder |
newOrder |
Variables you want in the order you wish to have |
force |
Just assume input is value (default = FALSE) |
- the re-ordered/resized matrix
- <https://github.com/tbates/umx>
Other Data Functions:
noNAs()
,
prolific_anonymize()
,
prolific_check_ID()
,
prolific_read_demog()
,
umxFactor()
,
umxHetCor()
,
umx_as_numeric()
,
umx_cont_2_quantiles()
,
umx_lower2full()
,
umx_make_MR_data()
,
umx_make_TwinData()
,
umx_make_fake_data()
,
umx_make_raw_from_cov()
,
umx_merge_randomized_columns()
,
umx_polychoric()
,
umx_polypairwise()
,
umx_polytriowise()
,
umx_read_lower()
,
umx_rename()
,
umx_score_scale()
,
umx_select_valid()
,
umx_stack()
,
umx_strings2numeric()
,
umx
oldMatrix = cov(mtcars)
umx_reorder(oldMatrix, newOrder = c("mpg", "cyl", "disp")) # first 3
umx_reorder(oldMatrix, newOrder = c("hp", "disp", "cyl")) # subset and reordered
umx_reorder(oldMatrix, "hp") # edge-case of just 1-var
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.