Add partition for each column for chronologically ordered data using regression trees (mvpart::rpart()).

add_data_partition(data_source_var, data_source_levels, age_var = "age")

Arguments

data_source_var

A dataframe with samples as rows and variables as columns. This dataframe must contain a "sample_id" column.

data_source_levels

A dataframe with one row per sample, where the sample_id column must match the data_source_var dataframe. This dataframe must contain an "age" column.

age_var

A character string indicating the name of the age column in the data_source_levels dataframe. The default value is "age".

Value

A dataframe with the same columns as data_source_var plus a column for each partition, named as variable name plus "_part".

See also

regression_partition(), mvpart::rpart()