convert | R Documentation |
Convert data type of columns
num(..., .args = list())
chr(..., .args = list())
lgl(..., .args = list())
int(..., .args = list())
dbl(..., .args = list())
fct(..., .args = list())
dtm(..., .args = list())
dte(..., .args = list())
convert(.x, ...)
... |
Scoping functions, see details |
.args |
extra argument to be passed to support function. |
.x |
A data.frame |
a tbl data frame
vignette("convert")
, vignette("hablar")
## Not run:
# Change one column to numeric and another to character
mtcars %>%
convert(num(gear),
chr(mpg))
# Changing multiple data types on multiple columns
mtcars %>%
convert(int(hp,
wt),
fct(qsec,
cyl,
drat))
# Also works with tidyselect convenience functions
mtcars %>%
convert(int(vs:carb),
fct(last_col()))
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.