Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

extract_ptype

Extract a prototype


Description

extract_ptype() extracts a tibble with 0 rows from data. This contains all of the required information about column names, classes, and factor levels that are required to check the structure of new data at prediction time.

Usage

extract_ptype(data)

Arguments

data

A data frame or matrix.

Details

extract_ptype() is useful when creating a new preprocessing blueprint. It extracts the required information that will be used by the validation checks at prediction time.

Value

A 0 row slice of data after converting it to a tibble.

Examples

hardhat:::extract_ptype(iris)

hardhat

Construct Modeling Packages

v0.1.5
MIT + file LICENSE
Authors
Davis Vaughan [aut, cre], Max Kuhn [aut], RStudio [cph]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.