rsample
Classes and functions to create and summarize resampling objects
rsample provides functions to create different types of resamples (like bootstraps, cross-validation folds, and train/test splits) for R data analysis. It’s designed as a modular toolset for generating resampled datasets to estimate sampling distributions or evaluate model performance using holdout sets.
The package uses a memory-efficient approach where resampled datasets don’t duplicate the original data in memory—creating 50 bootstrap samples uses only about 2.5 times the memory of the original dataset rather than 50 times. rsample focuses specifically on creating and managing resamples rather than modeling or statistics calculation, making it a foundational building block that integrates with other tidymodels packages. It’s part of the tidymodels ecosystem for machine learning workflows in R.
Contributors#
Resources featuring rsample#
posit::conf(2023) Workshop: Advanced tidymodels
Register now: http://pos.it/conf Instructor: Max Kuhn, Software Engineer, Posit Workshop Duration: 1-Day Workshop
This workshop is for you if you: • have used tidymodels packages like recipes, rsample, and parsnip • are comfortable with tidyverse syntax (e.g. piping, mutates, pivoting) • have some experience with resampling and modeling (e.g., linear regression, random forests, etc.), but we don’t expect you to be an expert in these
In this workshop, you will learn more about model optimization using the tune and finetune packages, including racing and iterative methods. You’ll be able to do more sophisticated feature engineering with recipes. Time permitting, model ensembles via stacking will be introduced. This course is focused on the analysis of tabular data and does not include deep learning methods.
Participants who have completed the “Introduction to tidymodels” workshop will be well-prepared for this course. Participants who are new to tidymodels will benefit from taking the Introduction to tidymodels workshop before joining this one

posit::conf(2023) Workshop: Introduction to tidymodels
Register now: http://pos.it/conf Instructors: Hannah Frick, Simon Couch, Emil Hvitfeldt Workshop Duration: 1-Day Workshop
This workshop is for you if you: • have intermediate R knowledge, experience with tidyverse packages, and either of the R pipes • can read data into R, transform and reshape data, and make a wide variety of graphs • have had some exposure to basic statistical concepts such as linear models, random forests, etc.
Intermediate or expert familiarity with modeling or machine learning is not required.
This workshop will teach you core tidymodels packages and their uses: data splitting/resampling with rsample, model fitting with parsnip, measuring model performance with yardstick, and basic pre-processing with recipes. Time permitting, you’ll be introduced to model optimization using the tune package. You’ll learn tidymodels syntax as well as the process of predictive modeling for tabular data





