Learn R Programming

modelbased (version 0.6.0)

data_restoretype: Restore the type of columns according to a reference data.frame

Description

Restore the type of columns according to a reference data.frame

Usage

data_restoretype(data, reference_data = NULL)

Arguments

data

The data.

reference_data

A reference dataframe from which to find the correct column types.

Examples

Run this code
# NOT RUN {
library(modelbased)

x <- data.frame(
  Sepal.Length = c("1", "3", "2"),
  Species = c("setosa", "versicolor", "setosa")
)
fixed <- data_restoretype(x, reference_data = iris)
summary(fixed)
# }

Run the code above in your browser using DataLab