Related to the discussion in this post.
There are multiple ways of executing an R-file. Each of these methods have either challenges in input or output. Which are acceptable to count as "Full program" and how do we score them?
The options are:
Using the command line command
rscript <filename>
. This seems to be the most intuitive way to call a script. However, STDIN needs to be explicitly calls when usingscan()
, which is one of the most popular methods of reading input in full programs. This would becomescan(file("stdin"))
. Also, this requires explicit printing, usingcat
orprint
. Both these limitations would invalidate a lot if not all full program submissions.Calling
source
in the R console.source
is similar to Python'simport
, it executes a given file. STDIN works properly without modifications, but printing is the same problem asrscript
.Calling
source
with argumentecho = TRUE
(which can be abbreviated toec=T
). This will print all executed lines of code with their output as if they were executed directly in the console.
If I missed any, please let me know.
The question is two-part: Do we allow source
as a way to execute or only rscript
? If source
is allowed, how do we score its arguments?