Some variables were categorized via quantcut() in train_df and I want to apply same categories intervals to test_df without having to create ifelse conditions for every variable.
In the following example, I want to apply the interval from train_df$tenor_q to test_df$tenor
train_df <- train_df %>% mutate(tenor_q = quantcut(tenor,4))
attributes(train_df$tenor_q)
$levels
[1] "[6,36]" "(36,48)" "48" "(48,60]"
Thank you