View source: R/dplyr-funcs-type.R
cast | R Documentation |
This is a wrapper around the $cast()
method that many Arrow objects have.
It is more convenient to call inside dplyr
pipelines than the method.
cast(x, to, safe = TRUE, ...)
x |
an |
to |
DataType to cast to; for Table and RecordBatch, it should be a Schema. |
safe |
logical: only allow the type conversion if no data is lost
(truncation, overflow, etc.). Default is |
... |
specific |
An Expression
data-type
for a list of DataType to be used with to
.
Arrow C++ CastOptions documentation # nolint for the list of supported CastOptions.
## Not run:
mtcars %>%
arrow_table() %>%
mutate(cyl = cast(cyl, string()))
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.