# How should a full program in R be invoked?

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 using scan(), which is one of the most popular methods of reading input in full programs. This would become scan(file("stdin")). Also, this requires explicit printing, using cat or print. Both these limitations would invalidate a lot if not all full program submissions.

• Calling source in the R console. source is similar to Python's import, it executes a given file. STDIN works properly without modifications, but printing is the same problem as rscript.

• Calling source with argument echo = TRUE (which can be abbreviated to ec=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?

# Allow source, add the arguments to bytecount similar to flags.
As for scoring, we can consider the ec=T as a flag and add 4 bytes to the bytecount.