coder: Apply functions to multiple variables in a data frame

View source: R/encode_decode.R

coderR Documentation

Apply functions to multiple variables in a data frame

Description

The coder() function applies a set of functions to multiple variables in a data frame using dplyr's mutate() and across() functions.

Usage

coder(.data, .fns)

Arguments

.data

The input data frame.

.fns

A set of functions to be applied to the variables in the data frame.

Value

A modified data frame with the functions applied to the variables.

Examples

# Apply the `mean()` function to multiple variables in the `mtcars` data frame
coder(mtcars, mean)


myominnoo/mStats documentation built on Nov. 29, 2023, 2:36 a.m.