I've been using for while Rstudio with R pre-installed, as usual. Some days ago I decided to run absolutely everything I can in the terminal/CLI, since some GUI/IDEs keep crashing over and over and doing my stuff in vim seem to me to be enough. I googled and tried to run a R script that I used to run with Rstudio, now using Rscript. I also added R and Rscript to PATH, ran chmod +x to the file, added the shebang to the R file, and yet the message that I get is this:
Error: RStudio not running
Execution halted
So, what am I doing wrong? Why does it seem Rstudio is trying to run this script if I haven't even tried to use it in the command line? I have erased almost all the code and left only one line, that calls another R script, which clears the environment:
#!/usr/bin/Rscript
# Clears everything
source("cleanAll.R")
cleanAll.R code:
rm(list = ls()) # Clears global environment
cat("\014") # Clears the console
setwd(dirname(rstudioapi::getActiveDocumentContext()$path))
graphics.off()