I want to use around 50 variable columns of my data as factors for my model and try to figure out an elegant way instead of using a long list of all variables.
rpart(output_variable ~ Variable1 + Variable2 + Variable3 + Variable4, data=Train_Set, method="class")
I try
rpart(output_variable ~ dataset[,12:50], data=Train_Set, method="class")
but that just brings "invalid type (list)
any idea how I can elegantly select multiple variables or save them to reference them in a formula?