Learn R Programming

umx (version 1.4.0)

umx_apply: umx_apply

Description

Tries to make apply more readable. Other functions to think of include cumsum, rowSums, colMeans, etc.

Usage

umx_apply(FUN, of, by = "columns", ...)

Arguments

FUN
The function to apply
of
The dataframe to work with
by
What to apply the function to: columns or rows (default = "columns")
...
optional arguments to FUN, i.e., na.rm = T

Value

- object

References

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

See Also

- umx_aggregate

Other Misc: umxEval, umx_APA_model_CI, umx_add_variances, umx_default_option, umx_get_bracket_addresses, umx_object_as_str, umx_string_to_algebra, umx

Examples

Run this code
umx_apply(mean, mtcars, by = "columns")
umx_apply(mean, of = mtcars, by = "columns")
umx_apply(mean, by = "rows", of = mtcars[1:3,], na.rm = TRUE)

Run the code above in your browser using DataLab