如何创建 R 脚本来运行位于特定文件夹中的 R 脚本?

发布于 2025-01-14 18:01:27 字数 558 浏览 5 评论 0原文

我正在使用 RStudio(操作系统:Windows 10),并且我的 C 驱动器上的特定文件夹中有大约 10 个 R 脚本。

我正在寻找一个 R 脚本,它可以依次执行文件夹中的这些 R 脚本(不是并行)。

另外,我需要 RScript 在 RStudio 中运行,而不是在命令提示符窗口中运行。

其他信息:

R 脚本位置:C:\myfiles\R\Rscripts 该文件夹中的 RScript 列表(显示摘录):

08dec22-15dec22.R

21jan22-27jan22.R

10feb23-17feb23.R

...

我检查了此处提供的答案,但我不知道如何根据我的需要自定义它们: 运行 R 脚本文件夹,每个脚本位于一个不同的 R 实例

任何帮助将不胜感激。

I am using RStudio (OS: Windows 10) and I have around 10 R scripts located in a specific folder on my C drive.

I am looking for an R Script that can execute those R Scripts in the folder one after the other (not in parallel).

Also, I need the RScripts to run in RStudio and not in a Command Prompt Window.

Additional info:

R scripts location: C:\myfiles\R\Rscripts
List of RScripts in that folder (extract shown):

08dec22-15dec22.R

21jan22-27jan22.R

10feb23-17feb23.R

...

I checked the answers provided here but I cannot figure out how to customize them for my needs: Running a Folder of R Scripts, each in a different R instance

Any help would be much appreciated.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文