I am using the train function of caret package with r. If I specify a package that I have not installed, method displays the following.
1 package is needed for this model and is not installed. (***). Would you like to try to install it now?
1: yes
2: no
I would like to answer all "1: yes" without entering this question by hand every time, but how can it be done?