10 October 2019
Jumping Rivers meetingsR
list:
Website: https://jumpingrivers.github.io/meetingsR/
GitHub: https://github.com/jumpingrivers/meetingsR/
README: …/blob/master/README.md
git
terminologyFORK - Make me a copy of this repo(sitory) on github
PULL - Download this repo to my computer
(Make the changes you need)
ADD / COMMIT - Add these changes to my local copy of this repo
PUSH - Upload my updated version of this repo to github
PULL REQUEST - Tell the author of this repo that they can include my changes
Add “Glasgow R” to the meetingsR
list using github
Not all contributions are code contributions [… or docs …]
…
Just helping people filter, and curate, and figure-out what is in a ticket and if it’s really important… I can’t tell you how useful this is
Heather C Miller: Interviewed on CoRecursive podcast (2019-09-15)
lintr
and your codelibrary(lintr) # lintr 2.0.0; author: Jim Hester
# Temp file abc = 123 my.df <- data.frame(x = 1:3, y = rnorm(3)) is_it_a_matrix <- sapply(1:3, function(x) rbinom(x, 10, 0.5)) message("superfluous_semicolon");
lint(filename = f)
## /home/ah327h/workshops/glar_201910/temp/lint_me.R:2:5: style: Use <-, not =, for assignment. ## abc = 123 ## ^ ## /home/ah327h/workshops/glar_201910/temp/lint_me.R:3:1: style: Variable and function name style should be snake_case. ## my.df <- data.frame(x = 1:3, y = rnorm(3)) ## ^~~~~
lintr
issue (2017-06-27)lintr
PR (2018-09-17)Accepted 2018-09-18
Got into CRAN lintr
Sept 2019
What happened in between?
(Note : I was really fixing a problem with my package dupree)
One (few) main developer
Lots of open issues
questions, duplicates, bugs, feature requests
unlabelled or solved issues
To help: Curate and Filter
label the issues
close fixed issues
ask for / find a reproducible example
[But uncommon: Few packages, but many package developers, depend on lintr
)]
https://hacktoberfest.digitalocean.com/
GitHub labels
Ask
explainerr
- a sandbox project for learning git and regexeshttps://github.com/russHyde/explainerr/
explainerr::explain("object of type 'closure' is not subsettable")
## An example where this error comes up is when you've used [square brackets] ## instead of (parentheses) to surround the arguments to a function. ## ## If you wanted the `mean` of the numbers 1, 2 and 3, you should call ## `mean(c(1, 2, 3))`, but it's easy to call `mean[c(1, 2, 3)]` by mistake. In R, ## the square brackets are used for subsetting - `v[2]` pulls out the ## second entry of `v` (where `v` may be a list or a vector or something). ## ## So the syntax `mean[c(1, 2, 3)]` is attempting to get R to pull out the first ## three entries of some vector called mean; but `mean` is a function and so ## can't be subset in this way. ## ## Examples of non-subsettable things: ## ## mean[1:2] # mean is a function (a `closure`), did you expect `mean(1:2)`? ## c[1] # c is a function (a `builtin`), did you mean `c(1)`? ## `[`[1] # `[` is a function (a `special`) ## globalenv()[1] # globalenv() returns an `environment` ##
Slides: http://rpubs.com/russH/535683
More about Open-Source Contribution
Creating a pull request using git
Creating a pull request using R and usethis
Can OS projects be healthily maintained?
Open Source Health and Diversity (CoRecursive)
Experimental things on github (@russHyde)
lintr
)Recent contributions to bigger projects
lint( filename = f, linters = with_defaults( assignment_linter = NULL, # "abc = 123" is fine fns = undesirable_function_linter(), # catch `sapply` semis = semicolon_terminator_linter() ) )
## /home/ah327h/workshops/glar_201910/temp/lint_me.R:3:1: style: Variable and function name style should be snake_case. ## my.df <- data.frame(x = 1:3, y = rnorm(3)) ## ^~~~~ ## /home/ah327h/workshops/glar_201910/temp/lint_me.R:4:19: warning: Function "sapply" is undesirable. As an alternative, use vapply() or lapply(). ## is_it_a_matrix <- sapply(1:3, function(x) rbinom(x, 10, 0.5)) ## ^~~~~~ ## /home/ah327h/workshops/glar_201910/temp/lint_me.R:5:33: style: Trailing semicolons are not needed. ## message("superfluous_semicolon"); ## ^