How to run R script from task scheduler via .bat file

I am new when something comes outside the encoding for R. I have looked at a lot of similar messages, but they are not detailed enough, as I am not familiar with many conditions.

I have a simple R script that is saved on a C: drive. I want it to now run from a .bat file, which I will use later in the task scheduler to automatically run every time after its operation.

I saw a lot of posts pointing to the link.

The link refers to the working directory, but then never mentions anything. How does the Windows team know the .R script folder if it never seems to be typed? Now I have changed the working directory:

cd C:\Program Files\R\R-3.0.1\bin\x64

I do not know where to go from there.

Edit: I am running windows 7

+4
source share
1 answer

On Linux:

R CMD BATCH [options] my_script.R [outfile]

On Microsoft Windows (adjust the path to R.exe if necessary):

"C:\Program Files\R\R-2.13.1\bin\R.exe" CMD BATCH 
   --vanilla --slave "c:\my projects\my_script.R"

From here .

+5
source

All Articles