Open steffilazerte opened 2 years ago
Excellent idea!
library() not require()
That one could be automated! So if you go for this please open an issue in roblog.
Use a package more than a couple times, import it with library() rather than use pkg_name::
Ah I see what you mean but I tend to namespace all the things :joy: The guidance should mention this, something about balancing the clarity of where functions come from with the visual clutter.
Use comments to explain why using certain features (i.e. set.seed() etc.)
Nice. The review would help pinpoint what things are comment-worthy.
Be explicit about argument names when they're not common (i.e. I wouldn't worry about mean(c(1,2,3)) but I would worry about mean(c(1,2,3), 1, FALSE)
Good point!
I think I can write a small section in the Blog Guide for this, and have @maelle and @yabellini review it to make sure I'm not being too opinionated :grin:.
Looking forward to debating reviewing :wink:
Me too!
I tend to implement my own preferences for R code, and I'm not sure if we should chat about whether there are any standards that are important enough to put as a requirement in the Blog Guide.
For example, I enforce what I think is 'correct' or best practices coding:
library()
notrequire()
These are things I suggest in order to make code more understandable by readers who may not be as familiar, but I'm not sure I'd want to really add this to the blog guide, as they're somewhat subjective...
library()
rather than usepkg_name::
set.seed()
etc.)mean(c(1,2,3))
but I would worry aboutmean(c(1,2,3), 1, FALSE)