如何通过一个.bat文件运行任务调度A R脚本 [英] How to run a R script from the task scheduler via a .bat file

查看:467
本文介绍了如何通过一个.bat文件运行任务调度A R脚本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是一个新手,当谈到编码R.以外的任何东西,我抬头一看很多类似的帖子,但他们都不够详细,我不熟悉的许多条款。

I'm a novice when it comes anything outside of coding for R. I've looked up many similar posts but they aren't detailed enough as I'm unfamiliar with many of the terms.

我有一个的保存到C一个简易R脚本:驱动器。我希望它从现在.bat文件,我将在任务计划程序后使用自动每天一次,它的工作都跑。

I have a simple R script that's saved on the C: drive. I want it to run from a .bat file for now, which I will later use in the task scheduler to run automatically everyday once it's working.

我看了很多帖子指出,这链接

I saw many posts pointed to this link.

链接中提到的工作目录但从未提及任何一次它。如何Windows命令知道.R脚本的文件夹,如果它似乎从来没有输入?现在我已经改变了工作目录:

The link mentions the working directory but then never mentions anything it again. How does windows command know the folder of the .R script if it's never seems to be entered? Right now I've changed the working directory:

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

我不知道从哪里里去。

I don't know where to go from there.

编辑:我运行Windows 7

I'm running windows 7

推荐答案

在Linux上:

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

在Microsoft Windows(根据需要调整路径里面运行R.exe):

On Microsoft Windows (adjust the path to R.exe as needed):

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

这篇关于如何通过一个.bat文件运行任务调度A R脚本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆