mutate_if_cat {catcont} | R Documentation |
mutate_if_cat, mutate_if_cont
Description
mutates only categorical|continuous columns
Usage
mutate_if_cat(.tbl, .funs, ...)
## Default S3 method:
mutate_if_cat(.tbl, .funs, ...)
## S3 method for class 'data.table'
mutate_if_cat(.tbl, .funs, ...)
mutate_if_cont(.tbl, .funs, ...)
## Default S3 method:
mutate_if_cont(.tbl, .funs, ...)
## S3 method for class 'data.table'
mutate_if_cont(.tbl, .funs, ...)
Arguments
.tbl |
table |
.funs |
functions see |
... |
additional parameters |
Details
Mutates categorical or continuous columns.
The data.table variants do this as
Value
An object of class .tbl
in with columns mutated according to .funs
See Also
Similar to dplyr::mutate_if()
Examples
data(iris)
## Not run:
iris %>% mutate_if_cat( as.character )
library(data.table)
setDT(iris)
class(iris$Species)
iris %>% mutate_if_cat( as.character )
class(iris1$Species) # character
class(iris2)
iris %>% mutate_if_cont( add, 2 )
## End(Not run)
[Package catcont version 0.5.0 Index]