mutateAll | R Documentation |
Mutate multiple columns
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, ...)
object |
Object. |
fun |
|
... |
Passthrough arguments to function declared in |
vars |
|
predicate |
|
Modified object.
Updated 2023-02-07.
These functions are inspired by dplyr. However, they are designed to only work on Bioconductor S4 class objects, and use base R code internally.
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.