Learn R Programming

podcleaner (version 0.1.2)

utils_mutate_across: Mutate operation(s) in dataframe column(s)

Description

Applies provided function across specified column(s) in provided dataframe.

Usage

utils_mutate_across(df, columns, fun, ...)

Arguments

df

A dataframe.

columns

Vector of expression(s) or character string(s) specifying the columns to apply the function below to in the provided dataframe.

fun

Function to execute provided as an expression.

...

Argument(s) to be passed to the function above for execution.

Value

A dataframe.

Examples

Run this code
# NOT RUN {
  df <- data.frame(
    location = "glasgow", occupation = "wine merchant",
    stringsAsFactors = FALSE
  )
  utils_mutate_across(df, c("location", "occupation"), paste0, "!")
# }

Run the code above in your browser using DataLab