Learn R Programming

butcher (version 0.4.0)

axe-rsample-data: Axe data within rsample objects.

Description

Replace the splitting and resampling objects with a placeholder.

Usage

axe_rsample_data(x, verbose = FALSE, ...)

# S3 method for default axe_rsample_data(x, verbose = FALSE, ...)

# S3 method for rsplit axe_rsample_data(x, verbose = FALSE, ...)

# S3 method for three_way_split axe_rsample_data(x, verbose = FALSE, ...)

# S3 method for rset axe_rsample_data(x, verbose = FALSE, ...)

# S3 method for tune_results axe_rsample_data(x, verbose = FALSE, ...)

# S3 method for workflow_set axe_rsample_data(x, verbose = FALSE, ...)

Value

An updated object without data in the rsplit objects.

Arguments

x

An object.

verbose

Print information each time an axe method is executed. Notes how much memory is released and what functions are disabled. Default is FALSE.

...

Any additional arguments related to axing.

Methods

See the following help topics for more details about individual methods:

butcher

  • axe-rsample-data: default, rset, rsplit, three_way_split, tune_results, workflow_set

Details

Resampling and splitting objects produced by rsample contain rsplit objects. These contain the original data set. These data might be large so we sometimes wish to remove them when saving objects. This method creates a zero-row slice of the dataset, retaining only the column names and their attributes, while replacing the original data.

Examples

Run this code

large_cars <- mtcars[rep(1:32, 50), ]
large_cars_split <- rsample::initial_split(large_cars)
butcher(large_cars_split, verbose = TRUE)

Run the code above in your browser using DataLab