mutate: Mutate multiple columns

mutateAllR Documentation

Mutate multiple columns

Description

Mutate multiple columns

Usage

mutateAll(object, fun, ...)

mutateAll(object, fun, ...)

mutateIf(object, predicate, fun, ...)

transmuteAt(object, vars, fun, ...)

transmuteIf(object, predicate, fun, ...)

## S4 method for signature 'DFrame,function'
mutateAll(object, fun, ...)

## S4 method for signature 'DFrame,character,function'
mutateAt(object, vars, fun, ...)

## S4 method for signature 'DFrame,function,function'
mutateIf(object, predicate, fun, ...)

## S4 method for signature 'DFrame,character,function'
transmuteAt(object, vars, fun, ...)

## S4 method for signature 'DFrame,function,function'
transmuteIf(object, predicate, fun, ...)

Arguments

object

Object.

fun

function. Mutation function.

...

Passthrough arguments to function declared in fun argument.

vars

character. Column names.

predicate

function. A predicate function to be applied to the columns. For example, is.atomic().

Value

Modified object.

Note

Updated 2023-02-07.

See Also

These functions are inspired by dplyr. However, they are designed to only work on Bioconductor S4 class objects, and use base R code internally.

Examples

data(mtcars, package = "datasets")

## DFrame ====
x <- as(mtcars, "DFrame")
mutateAll(x, fun = log, base = 2L)
mutateAt(x, vars = c("mpg", "cyl"), fun = log, base = 2L)
mutateIf(x, predicate = is.double, fun = as.integer)
transmuteAt(x, vars = c("mpg", "cyl"), fun = log, base = 2L)
transmuteIf(x, predicate = is.double, fun = as.integer)

acidgenomics/r-acidplyr documentation built on July 4, 2025, 5:55 a.m.