Skip to contents

Given a dataframe and the results of train_test_split(), return just the data for subjects that were assigned the specified split.

Usage

keep_split(df, assigned_df, split, uid = NULL)

Arguments

df

Dataframe to be subsetted into training or testing split

assigned_df

Dataframe containing "subjectkey" and "split" cols from train_test_assign()

split

String indicating which split to keep ("train" or "test")

uid

(string) the name of the uid column currently used data

Value

split_df Dataframe subsetted to specified split