extract_set | R Documentation |
Extract train set or test set from split_df class object
extract_set(x, set = c("train", "test"))
x |
an object of class "split_df", usually, a result of a call to split_df(). |
set |
character. Specifies whether the extracted data is a train set or a test set. You can use "train" or "test". |
Extract the train or test sets based on the parameters you defined when creating split_df with split_by().
an object of class "tbl_df".
library(dplyr)
# Credit Card Default Data
head(ISLR::Default)
# Generate data for the example
sb <- ISLR::Default %>%
split_by(default)
train <- sb %>%
extract_set(set = "train")
test <- sb %>%
extract_set(set = "test")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.