Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What are the commands for R language to execute scripts?

2025-01-20 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/03 Report--

This article mainly introduces the commands of R language to execute the script, which has a certain reference value, interested friends can refer to, I hope you can learn a lot after reading this article, let the editor take you to know it.

Environment variables should be added before R CMD BATCH and Rscript are used.

Add C:\ Program Files\ R\ R Murray 3.3.0\ bin; to the beginning of the Path value of the system variable

You can use R CMD BATCH * .r

You can also use Rscript * .r args0 args1, which can follow a certain parameter.

Of course, you can also enter the R interactive environment > source ("* .r")

The first command applies to Windows and Mac

The second command applies to Linux

The third command applies, but not with command line arguments

If there is a function in the R script and there are parameters in the function, you can use args (function) to view the parameters of the function.

> paramValue source ("myRfile.R")

There is a parameter in myRfile.R that teaches paramValue, so you can assign a value to paramValue first, and then source R script

Reference: http://r.789695.n4.nabble.com/Command-line-arguments-with-source-Windows-OS-td874573.html

Rscript-e can directly execute expressions in the R language, as follows:

Thank you for reading this article carefully. I hope the article "what are the commands for executing scripts in R language" shared by the editor will be helpful to you. At the same time, I also hope that you will support and pay attention to the industry information channel. More related knowledge is waiting for you to learn!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development