Learn R Programming

umx (version 1.7.5)

umx_names: umx_names

Description

Convenient equivalent of grep("fa[rl].*", names(df), value = TRUE, ignore.case = TRUE) Can handle dataframe (uses names), model (uses parameter names), or a vector of strings.

Usage

umx_names(df, pattern = ".*", ignore.case = TRUE, perl = FALSE,
  value = TRUE, fixed = FALSE, useBytes = FALSE, invert = FALSE)

Arguments

df

dataframe to get names from

pattern

= "find.*"

ignore.case

default = TRUE (opposite default to grep)

perl

= FALSE

value

= default = TRUE (opposite default to grep)

fixed

= FALSE

useBytes

= FALSE

invert

= FALSE

Value

- vector of matches

References

- http://tbates.github.io, https://github.com/tbates/umx

See Also

Other Utility Functions: qm, umx_find_object, umx_grep, umx_msg, umx_paste_names, umx_pb_note, umx_print, umx_rename, umx

Examples

Run this code
# NOT RUN {
umx_names(mtcars, "mpg") #"mpg" "cyl" "disp" "hp" "drat" "wt" "qsec" "vs" "am" "gear" "carb"
umx_names(mtcars, "^d") # "disp", drat
umx_names(mtcars, "r[ab]") # "drat", "carb"
# }

Run the code above in your browser using DataLab