Description Usage Arguments Value Note See Also Examples
Mutate multiple columns
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | mutateAll(object, fun, ...)
mutateAll(object, fun, ...)
mutateIf(object, predicate, fun, ...)
transmuteAt(object, vars, fun, ...)
transmuteIf(object, predicate, fun, ...)
## S4 method for signature 'DataFrame,'function''
mutateAll(object, fun, ...)
## S4 method for signature 'DataFrame,character,'function''
mutateAt(object, vars, fun, ...)
## S4 method for signature 'DataFrame,'function','function''
mutateIf(object, predicate, fun, ...)
## S4 method for signature 'DataFrame,character,'function''
transmuteAt(object, vars, fun, ...)
## S4 method for signature 'DataFrame,'function','function''
transmuteIf(object, predicate, fun, ...)
|
object |
Object. |
fun |
|
... |
Passthrough arguments to function declared in |
vars |
|
predicate |
|
Modified object.
Updated 2020-01-08.
These functions are inspired by dplyr. However, they are designed to only work on Bioconductor S4 class objects, and use base R code internally.
1 2 3 4 5 6 7 8 9 | data(mtcars, package = "datasets")
## DataFrame ====
x <- as(mtcars, "DataFrame")
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.