umx_strings2numeric: A wrapper to map columns of strings to numeric.

umx_strings2numericR Documentation

A wrapper to map columns of strings to numeric.

Description

If you give one column name, this is changed to numeric, and returned as a vector. If you give multiple column names, or don't set cols, each is changed to numeric, and the updated data.frame is returned.

Usage

umx_strings2numeric(df, cols = NA, mapStrings = NULL)

Arguments

df

The df

cols

(optional) list of columns (default = use all)

mapStrings

legal strings which will be mapped in order to numbers.

Value

  • df

See Also

Other Data Functions: noNAs(), prolific_anonymize(), prolific_check_ID(), prolific_read_demog(), umx, 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_reorder(), umx_score_scale(), umx_select_valid(), umx_stack()

Examples

tmp = data.frame(x=letters)
umx_strings2numeric(tmp, mapStrings = letters)
umx_strings2numeric(tmp, cols= "x", mapStrings = letters)

tbates/umx documentation built on Dec. 14, 2024, 11:28 a.m.