I was trying to run Rscript dosth.R
in the command line. In the script, I used select
function from dplyr
package. I got the following error message:
Error in UseMethod("select_") :
no applicable method for 'select_' applied to an object of class "factor"
Calls: %>% ... withVisible -> -> select -> select.default -> select_
Execution halted
However, I could successfully run the main function inside this "dosth.R" script in RStudio.
I want to solve this problem because eventually I would like to put all the codes in a script which can be run in the command line.
I wonder whether you have met this problem and would greatly appreciate your kind help.