R Language Standardize analyses by writing standalone R scripts

Help us to keep this website almost Ad Free! It takes only 10 seconds of your time:
> Step 1: Go view our video on YouTube: EF Core Bulk Extensions
> Step 2: And Like the video. BONUS: You can also share it!

Introduction

If you want to routinely apply an R analysis to a lot of separate data files, or provide a repeatable analysis method to other people, an executable R script is a user-friendly way to do so. Instead of you or your user having to call R and execute your script inside R via source(.) or a function call, your user may simply call the script itself as if it was a program.

Remarks

To represent the standard input-/output channels, use the functions file("stdin") (input from terminal or other program via pipe), stdout() (standard output) and stderr() (standard error). Note that while there is the function stdin(), it can not be used when supplying a ready-made script to R, because it will read the next lines of that script instead of user input.



Got any R Language Question?