Re: [Rd] Conventions: Use of globals and main functions

2019-08-24 Thread Gábor Csárdi
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

[Rd] Conventions: Use of globals and main functions

2019-08-24 Thread Cyclic Group Z_1 via R-devel
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

[Rd] Fwd: Document colon equals `:=` operator ?

2019-08-24 Thread Ant F
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

[Rd] Suggestions for improved checks on CRAN/R

2019-08-24 Thread Iñaki Ucar
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