Learn R Programming

umx (version 1.9.1)

umx_swap_a_block: umx_swap_a_block

Description

Swap a block of rows of a dataset between two lists variables (typically twin 1 and twin2)

Usage

umx_swap_a_block(theData, rowSelector, T1Names, T2Names)

Arguments

theData

a data frame to swap within

rowSelector

rows to swap amongst columns

T1Names

the first set of columns

T2Names

the second set of columns

Value

- dataframe

See Also

- subset

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

Examples

Run this code
# NOT RUN {
test = data.frame(
a = paste0("a", 1:10),
b = paste0("b", 1:10),
c = paste0("c", 1:10),
d = paste0("d", 1:10), stringsAsFactors = FALSE)
umx_swap_a_block(test, rowSelector = c(1,2,3,6), T1Names = "b", T2Names = "c")
umx_swap_a_block(test, rowSelector = c(1,2,3,6), T1Names = c("a","c"), T2Names = c("b","d"))

# }

Run the code above in your browser using DataLab