You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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() not require()
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...
Use a package more than a couple times, import it with library() rather than use pkg_name::
Use comments to explain why using certain features (i.e. set.seed() etc.)
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)
The text was updated successfully, but these errors were encountered:
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 😂 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!
steffilazerte
changed the title
Consider guideance for R code?
Consider guidance for R code?
Jul 26, 2022
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 😁.
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)
The text was updated successfully, but these errors were encountered: