View source: R/data_restoretype.R
data_restoretype | R Documentation |
Restore the type of columns according to a reference data frame
data_restoretype(data, reference = NULL, ...)
data |
A data frame for which to restore the column types. |
reference |
A reference data frame from which to find the correct
column types. If |
... |
Currently not used. |
A data frame with columns whose types have been restored based on the reference data frame.
data <- data.frame(
Sepal.Length = c("1", "3", "2"),
Species = c("setosa", "versicolor", "setosa"),
New = c("1", "3", "4")
)
fixed <- data_restoretype(data, reference = iris)
summary(fixed)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.