This is what I usually put in scripts:
if (is.null(sys.calls())) {
main()
}
This is mostly equivalent to the Python idiom. It the script runs from
Rscript, then it will run main(). It also lets you source() the
script, and debug its functions, test them, etc. It works best if all
the code in th
In R scripts (as opposed to packages), even in reproducible scripts, it seems
fairly conventional to use the global workspace as a sort of main function, and
thus R scripts often populate the global environment with many variables, which
may be mutated. Although this makes sense given R has hist
Dear all,
There was some discussion lately on twitter (
https://twitter.com/geospacedman/status/1164208293377691648 ) about the
status of the colon equal operator. I'm sure it has been discussed in the
past but I couldn't find anything, I'll start by clarifying all i can by
myself to have strong r
Dear CRAN maintainers, R core team,
Here are some suggestions to prevent some issues I found in several
packages on CRAN. Some of these issues have been reported to their
maintainers, but still I believe it would be desirable to enforce
these on CRAN or in the corresponding R CMD.
- Checks for un