Unlimited learning, half price | 50% off

Last chance! 50% off unlimited learning

Sale ends in


datawizard (version 0.4.1)

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 = NULL, ...)

Value

A dataframe with columns whose types have been restored based on the reference dataframe.

Arguments

data

A data frame to pivot.

reference

A reference data frame from which to find the correct column types.

...

Additional arguments passed on to methods.

Examples

Run this code
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)

Run the code above in your browser using DataLab