pratikunterwegs / tres-tidy-tutorial

A tidyverse tutorial for TRES.
https://pratikunterwegs.github.io/tres-tidy-tutorial/
6 stars 0 forks source link

Suggest: add lintr + volunteer #49

Open richelbilderbeek opened 4 years ago

richelbilderbeek commented 4 years ago

lintr is the package to check if code follows the Tidyverse coding standard. For a Tidyverse tutorial, this makes sense. I suggest to add a lintr check within the Travis CI build (assuming it is enabled, as requested in #48).

I volunteer to add this to the Travis CI file. If chapters do not pass the lintr requirements, I will contact their authors. If the authors refuse to update their style, I also volunteer to fix that.

richelbilderbeek commented 4 years ago

I already added a check_style.R and check_style.sh to check for Tidyverse style :+1:

richelbilderbeek commented 4 years ago

Running it I see that my chapter and @rscherrer's chapter are cleanly following the Tidyverse standard:

********************************************************************************
05_graphics_with_ggplot2.Rmd
********************************************************************************
********************************************************************************
06_regex_and_testthat.Rmd
********************************************************************************
********************************************************************************
07_programming_in_the_tidyverse.rmd
********************************************************************************
richelbilderbeek commented 4 years ago

These are all style errors now:

/home/richel/GitHubs/tres-tidy-tutorial/01_read_data_wrangle_strings.rmd:29:14: style: Use <-, not =, for assignment.
some_example = readr_example("mtcars.csv")
             ^
/home/richel/GitHubs/tres-tidy-tutorial/01_read_data_wrangle_strings.rmd:32:14: style: Use <-, not =, for assignment.
some_example = read_csv(some_example)
             ^
/home/richel/GitHubs/tres-tidy-tutorial/01_read_data_wrangle_strings.rmd:66:7: style: Use <-, not =, for assignment.
model = lm(mpg ~ wt, data = mtcars)
      ^
/home/richel/GitHubs/tres-tidy-tutorial/01_read_data_wrangle_strings.rmd:73:14: style: Use <-, not =, for assignment.
model_output = capture.output(summary(model))
             ^
/home/richel/GitHubs/tres-tidy-tutorial/01_read_data_wrangle_strings.rmd:84:14: style: Use <-, not =, for assignment.
model_output = read_lines("model_output.txt")
             ^
/home/richel/GitHubs/tres-tidy-tutorial/01_read_data_wrangle_strings.rmd:123:14: style: Use <-, not =, for assignment.
class_tibble = class(tibble::tibble(a = 1))
             ^
/home/richel/GitHubs/tres-tidy-tutorial/01_read_data_wrangle_strings.rmd:304:10: style: Use <-, not =, for assignment.
filename = "sim_param1_0.01_param2_0.05_param3_0.01.ext"
         ^
/home/richel/GitHubs/tres-tidy-tutorial/01_read_data_wrangle_strings.rmd:333:10: style: Use <-, not =, for assignment.
filename = "sim_param1_0.01_param2_0.05_param3_0.01.ext"
         ^
/home/richel/GitHubs/tres-tidy-tutorial/01_read_data_wrangle_strings.rmd:345:10: style: Use <-, not =, for assignment.
filename = "sim_param1_0.01_param2_0.05_param3_0.01.ext"
         ^
/home/richel/GitHubs/tres-tidy-tutorial/01_read_data_wrangle_strings.rmd:346:22: style: Use <-, not =, for assignment.
filename_with_spaces = str_replace_all(filename,
                     ^
/home/richel/GitHubs/tres-tidy-tutorial/01_read_data_wrangle_strings.rmd:349:25: style: Use <-, not =, for assignment.
filename_without_spaces = str_trim(filename_with_spaces)
                        ^
/home/richel/GitHubs/tres-tidy-tutorial/01_read_data_wrangle_strings.rmd:382:12: style: Use <-, not =, for assignment.
date_times = c("1970-somemonth-25",
           ^
/home/richel/GitHubs/tres-tidy-tutorial/01_read_data_wrangle_strings.rmd:441:6: style: Use <-, not =, for assignment.
cars = rownames(head(mtcars))
     ^
/home/richel/GitHubs/tres-tidy-tutorial/01_read_data_wrangle_strings.rmd:442:6: style: Only use double-quotes.
glue('The {cars} is a car model')
     ^~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/richel/GitHubs/tres-tidy-tutorial/01_read_data_wrangle_strings.rmd:452:24: style: Use <-, not =, for assignment.
parameter_combinations = data.frame(param1 = letters[1:5],
                       ^
/home/richel/GitHubs/tres-tidy-tutorial/01_read_data_wrangle_strings.rmd:457:11: style: Only use double-quotes.
          'simulation-name {param1} {param2}')
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/richel/GitHubs/tres-tidy-tutorial/01_read_data_wrangle_strings.rmd:461:11: style: Only use double-quotes.
          'sim_data_param1_{param1}_param2_{param2}.ext')
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/richel/GitHubs/tres-tidy-tutorial/01_read_data_wrangle_strings.rmd:486:12: style: Use <-, not =, for assignment.
car_labels = word(rownames(mtcars))
           ^
/home/richel/GitHubs/tres-tidy-tutorial/01_read_data_wrangle_strings.rmd:490:38: style: Put spaces around all infix operators.
           label = rownames(mtcars)))+
                                    ~^~
/home/richel/GitHubs/tres-tidy-tutorial/01_read_data_wrangle_strings.rmd:491:29: style: Put spaces around all infix operators.
  geom_point(colour = "red")+
                           ~^~
/home/richel/GitHubs/tres-tidy-tutorial/01_read_data_wrangle_strings.rmd:497:1: style: Trailing blank lines are superfluous.

^
/home/richel/GitHubs/tres-tidy-tutorial/02_reshaping_data.Rmd:227:21: style: Commas should always have a space after.
data <- data[!to_rm,]
                    ^
/home/richel/GitHubs/tres-tidy-tutorial/02_reshaping_data.Rmd:249:1: style: Variable and function name style should be snake_case.
nrow_Isabela <- with(data, length(which(island == "Isabela")))
^~~~~~~~~~~~
/home/richel/GitHubs/tres-tidy-tutorial/02_reshaping_data.Rmd:250:1: style: Variable and function name style should be snake_case.
nrow_SantaCruz <- with(data, length(which(island == "Santa Cruz")))
^~~~~~~~~~~~~~
/home/richel/GitHubs/tres-tidy-tutorial/02_reshaping_data.Rmd:251:1: style: Variable and function name style should be snake_case.
sites_Isabela <- sample(c("A", "B"), size = nrow_Isabela, replace = TRUE)
^~~~~~~~~~~~~
/home/richel/GitHubs/tres-tidy-tutorial/02_reshaping_data.Rmd:252:1: style: Variable and function name style should be snake_case.
sites_SantaCruz <- sample(c("C", "D"), size = nrow_SantaCruz, replace = TRUE)
^~~~~~~~~~~~~~~
/home/richel/GitHubs/tres-tidy-tutorial/02_reshaping_data.Rmd:351:1: style: Lines should not be more than 80 characters.
# Make the plotting code a function so we can re-use it without copying and pasting
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/richel/GitHubs/tres-tidy-tutorial/02_reshaping_data.Rmd:384:1: style: Lines should not be more than 80 characters.
fct_relevel(data$island, c("Isabela", "Santa Cruz"))[1:10] # same thing, different levels
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/richel/GitHubs/tres-tidy-tutorial/02_reshaping_data.Rmd:384:1: style: Lines should not be more than 80 characters.
fct_relevel(data$island, c("Isabela", "Santa Cruz"))[1:10] # same thing, different levels
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/richel/GitHubs/tres-tidy-tutorial/02_reshaping_data.Rmd:435:42: style: Commas should always have a space after.
data <- data[data$island == "Santa Cruz",] # keep only one island
                                         ^
/home/richel/GitHubs/tres-tidy-tutorial/03_data_manipulation_with_dplyr.Rmd:194:3: style: Commented code should be removed.
# 5 %>% .* 3 # neither
  ^~~~~~~~~~~~~~~~~~~~
/home/richel/GitHubs/tres-tidy-tutorial/03_data_manipulation_with_dplyr.Rmd:235:23: style: Place a space before left parenthesis, except in a function call.
phylacine %>% select(-(binomial:species))
                      ^
/home/richel/GitHubs/tres-tidy-tutorial/03_data_manipulation_with_dplyr.Rmd:388:42: style: `%>%` should always have a space before it and a new line after it, unless the full pipeline fits on one line.
  filter(mass_g %>% between(1e3, 1e5)) %>%
                                       ~~^
/home/richel/GitHubs/tres-tidy-tutorial/03_data_manipulation_with_dplyr.Rmd:690:68: style: `%>%` should always have a space before it and a new line after it, unless the full pipeline fits on one line.
life_habit <- phylacine %>% select(binomial, terrestrial:aerial) %>%
                                                                 ~~^
/home/richel/GitHubs/tres-tidy-tutorial/04_working_with_lists.rmd:27:6: style: Use <-, not =, for assignment.
data = read_csv("data/phylacine_traits.csv")
     ^
/home/richel/GitHubs/tres-tidy-tutorial/04_working_with_lists.rmd:28:6: style: Use <-, not =, for assignment.
data = data %>%
     ^
/home/richel/GitHubs/tres-tidy-tutorial/04_working_with_lists.rmd:38:13: style: Use <-, not =, for assignment.
nested_data = data %>%
            ^
/home/richel/GitHubs/tres-tidy-tutorial/04_working_with_lists.rmd:110:14: style: Use <-, not =, for assignment.
some_numbers = 1:3
             ^
/home/richel/GitHubs/tres-tidy-tutorial/04_working_with_lists.rmd:121:38: style: There should be a space between right parenthesis and an opening curly brace.
map_dbl(nested_data$data, function(df){
                                     ^~
/home/richel/GitHubs/tres-tidy-tutorial/04_working_with_lists.rmd:127:38: style: There should be a space between right parenthesis and an opening curly brace.
map_chr(nested_data$data, function(df){
                                     ^~
/home/richel/GitHubs/tres-tidy-tutorial/04_working_with_lists.rmd:136:14: style: Use <-, not =, for assignment.
some_numbers = c(NA, 1:3, NA, NaN, Inf, -Inf)
             ^
/home/richel/GitHubs/tres-tidy-tutorial/04_working_with_lists.rmd:169:13: style: Use <-, not =, for assignment.
nested_data = nested_data %>%
            ^
/home/richel/GitHubs/tres-tidy-tutorial/04_working_with_lists.rmd:175:44: style: Opening curly braces should never go on their own line and should always be followed by a new line.
    mean_mass = map_dbl(data, function(df) {mean(df$mass_g)}),
                                           ^
/home/richel/GitHubs/tres-tidy-tutorial/04_working_with_lists.rmd:181:16: style: Closing curly-braces should always be on their own line, unless it's followed by an else.
        first()}
               ^
/home/richel/GitHubs/tres-tidy-tutorial/04_working_with_lists.rmd:197:13: style: Use <-, not =, for assignment.
nested_data = nest(data, data = -order)
            ^
/home/richel/GitHubs/tres-tidy-tutorial/04_working_with_lists.rmd:199:13: style: Use <-, not =, for assignment.
nested_data = mutate(nested_data,
            ^
/home/richel/GitHubs/tres-tidy-tutorial/04_working_with_lists.rmd:204:45: style: There should be a space between right parenthesis and an opening curly brace.
                             .p = function(x){
                                            ^~
/home/richel/GitHubs/tres-tidy-tutorial/04_working_with_lists.rmd:210:45: style: There should be a space between right parenthesis and an opening curly brace.
                             .f = function(x){
                                            ^~
/home/richel/GitHubs/tres-tidy-tutorial/04_working_with_lists.rmd:242:11: style: Use <-, not =, for assignment.
this_list = list(a = "first letter",
          ^
/home/richel/GitHubs/tres-tidy-tutorial/04_working_with_lists.rmd:248:19: style: Only use double-quotes.
       glue::glue('{x} : {y}')
                  ^~~~~~~~~~~
/home/richel/GitHubs/tres-tidy-tutorial/04_working_with_lists.rmd:253:20: style: There should be a space between right parenthesis and an opening curly brace.
     function(x, .y){
                   ^~
/home/richel/GitHubs/tres-tidy-tutorial/04_working_with_lists.rmd:254:19: style: Only use double-quotes.
       glue::glue('{x} : {.y}')
                  ^~~~~~~~~~~~
/home/richel/GitHubs/tres-tidy-tutorial/04_working_with_lists.rmd:264:9: style: Use <-, not =, for assignment.
list_01 = as.list(1:3)
        ^
/home/richel/GitHubs/tres-tidy-tutorial/04_working_with_lists.rmd:265:9: style: Use <-, not =, for assignment.
list_02 = as.list(letters[1:3])
        ^
/home/richel/GitHubs/tres-tidy-tutorial/04_working_with_lists.rmd:266:9: style: Use <-, not =, for assignment.
list_03 = as.list(rainbow(3))
        ^
/home/richel/GitHubs/tres-tidy-tutorial/04_working_with_lists.rmd:270:29: style: There should be a space between right parenthesis and an opening curly brace.
         function(l1, l2, l3){
                            ^~
/home/richel/GitHubs/tres-tidy-tutorial/04_working_with_lists.rmd:271:23: style: Only use double-quotes.
           glue::glue('number {l1}, letter {l2}, colour {l3}')
                      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/richel/GitHubs/tres-tidy-tutorial/04_working_with_lists.rmd:297:40: style: There should be a space between right parenthesis and an opening curly brace.
                        .p = function(x){
                                       ^~
/home/richel/GitHubs/tres-tidy-tutorial/04_working_with_lists.rmd:303:40: style: There should be a space between right parenthesis and an opening curly brace.
                        .f = function(x){
                                       ^~
/home/richel/GitHubs/tres-tidy-tutorial/04_working_with_lists.rmd:316:39: style: Commas should always have a space after.
                            list(c(NA,NA))
                                      ^
/home/richel/GitHubs/tres-tidy-tutorial/04_working_with_lists.rmd:321:41: style: There should be a space between right parenthesis and an opening curly brace.
         m_coef = map(m_coef, function(x){
                                        ^~
/home/richel/GitHubs/tres-tidy-tutorial/04_working_with_lists.rmd:329:67: style: There should be a space between right parenthesis and an opening curly brace.
         plot = pmap(list(order, data, m_coef), function(ord, x, y){
                                                                  ^~
/home/richel/GitHubs/tres-tidy-tutorial/04_working_with_lists.rmd:332:29: style: Put spaces around all infix operators.
           ggplot2::ggplot()+
                           ~^~
/home/richel/GitHubs/tres-tidy-tutorial/04_working_with_lists.rmd:335:36: style: Put spaces around all infix operators.
                        size = 0.1)+
                                  ~^~
/home/richel/GitHubs/tres-tidy-tutorial/04_working_with_lists.rmd:336:29: style: Put spaces around all infix operators.
             scale_y_log10()+
                           ~^~
/home/richel/GitHubs/tres-tidy-tutorial/04_working_with_lists.rmd:337:38: style: Only use double-quotes.
             labs(title = glue::glue('order: {ord}'))
                                     ^~~~~~~~~~~~~~
/home/richel/GitHubs/tres-tidy-tutorial/04_working_with_lists.rmd:350:11: style: Use <-, not =, for assignment.
this_list = split(data, data$order) %>%
          ^
/home/richel/GitHubs/tres-tidy-tutorial/04_working_with_lists.rmd:351:18: style: There should be a space between right parenthesis and an opening curly brace.
  map(function(df){ split(df, df$iucn_status) })
                 ^~
/home/richel/GitHubs/tres-tidy-tutorial/04_working_with_lists.rmd:351:19: style: Opening curly braces should never go on their own line and should always be followed by a new line.
  map(function(df){ split(df, df$iucn_status) })
                  ^
/home/richel/GitHubs/tres-tidy-tutorial/04_working_with_lists.rmd:367:11: style: Use <-, not =, for assignment.
this_list = split(data, data$order)
          ^
/home/richel/GitHubs/tres-tidy-tutorial/04_working_with_lists.rmd:370:22: style: There should be a space between right parenthesis and an opening curly brace.
      function(df, .y){
                     ^~
/home/richel/GitHubs/tres-tidy-tutorial/04_working_with_lists.rmd:371:26: style: Only use double-quotes.
        print(glue::glue('{nrow(df)} species in order {.y}'))
                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/richel/GitHubs/tres-tidy-tutorial/04_working_with_lists.rmd:382:5: style: Use <-, not =, for assignment.
vec = as.integer(1:10)
    ^
/home/richel/GitHubs/tres-tidy-tutorial/04_working_with_lists.rmd:389:29: style: Opening curly braces should never go on their own line and should always be followed by a new line.
    modify(vec, function(x) { (x + 2) })
                            ^
/home/richel/GitHubs/tres-tidy-tutorial/04_working_with_lists.rmd:394:21: style: There should be a space between right parenthesis and an opening curly brace.
  error = function(e){
                    ^~
/home/richel/GitHubs/tres-tidy-tutorial/04_working_with_lists.rmd:403:25: style: Opening curly braces should never go on their own line and should always be followed by a new line.
modify(vec, function(x) { as.integer(x + 2) })
                        ^
/home/richel/GitHubs/tres-tidy-tutorial/04_working_with_lists.rmd:420:11: style: Use <-, not =, for assignment.
this_list = list(a = 1, b = -1, c = 2, d = NULL, e = NA)
          ^
/home/richel/GitHubs/tres-tidy-tutorial/04_working_with_lists.rmd:424:11: style: Use <-, not =, for assignment.
this_list = compact(this_list)
          ^
/home/richel/GitHubs/tres-tidy-tutorial/04_working_with_lists.rmd:429:11: style: Use <-, not =, for assignment.
this_list = discard(this_list, .p =is.na)
          ^
/home/richel/GitHubs/tres-tidy-tutorial/04_working_with_lists.rmd:429:35: style: Put spaces around all infix operators.
this_list = discard(this_list, .p =is.na)
                                  ^~
/home/richel/GitHubs/tres-tidy-tutorial/04_working_with_lists.rmd:432:32: style: There should be a space between right parenthesis and an opening curly brace.
keep(this_list, .p = function(x){ x > 0 })
                               ^~
/home/richel/GitHubs/tres-tidy-tutorial/04_working_with_lists.rmd:432:33: style: Opening curly braces should never go on their own line and should always be followed by a new line.
keep(this_list, .p = function(x){ x > 0 })
                                ^
/home/richel/GitHubs/tres-tidy-tutorial/04_working_with_lists.rmd:452:11: style: Use <-, not =, for assignment.
this_list = list(a = 1:3, b = 3:4, c = 5:10)
          ^
/home/richel/GitHubs/tres-tidy-tutorial/04_working_with_lists.rmd:463:8: style: Use <-, not =, for assignment.
mtcars = as_tibble(mtcars, rownames = "car")
       ^
/home/richel/GitHubs/tres-tidy-tutorial/04_working_with_lists.rmd:465:14: style: Use <-, not =, for assignment.
sampled_data = map(1:10, function(x){
             ^
/home/richel/GitHubs/tres-tidy-tutorial/04_working_with_lists.rmd:465:36: style: There should be a space between right parenthesis and an opening curly brace.
sampled_data = map(1:10, function(x){
                                   ^~
/home/richel/GitHubs/tres-tidy-tutorial/04_working_with_lists.rmd:466:32: style: Put spaces around all infix operators.
  sample_n(mtcars, nrow(mtcars)-5)
                              ~^~
/home/richel/GitHubs/tres-tidy-tutorial/04_working_with_lists.rmd:470:14: style: Use <-, not =, for assignment.
sampled_data = reduce(sampled_data,
             ^
/home/richel/GitHubs/tres-tidy-tutorial/04_working_with_lists.rmd:479:11: style: Use <-, not =, for assignment.
this_list = list(a = 1:3, b = 3:6, c = 5:10, d = c(1,2,5,10,12))
          ^
/home/richel/GitHubs/tres-tidy-tutorial/04_working_with_lists.rmd:479:54: style: Commas should always have a space after.
this_list = list(a = 1:3, b = 3:6, c = 5:10, d = c(1,2,5,10,12))
                                                     ^
/home/richel/GitHubs/tres-tidy-tutorial/04_working_with_lists.rmd:479:56: style: Commas should always have a space after.
this_list = list(a = 1:3, b = 3:6, c = 5:10, d = c(1,2,5,10,12))
                                                       ^
/home/richel/GitHubs/tres-tidy-tutorial/04_working_with_lists.rmd:479:58: style: Commas should always have a space after.
this_list = list(a = 1:3, b = 3:6, c = 5:10, d = c(1,2,5,10,12))
                                                         ^
/home/richel/GitHubs/tres-tidy-tutorial/04_working_with_lists.rmd:479:61: style: Commas should always have a space after.
this_list = list(a = 1:3, b = 3:6, c = 5:10, d = c(1,2,5,10,12))
                                                            ^
/home/richel/GitHubs/tres-tidy-tutorial/04_working_with_lists.rmd:492:11: style: Use <-, not =, for assignment.
this_list = list(a = rep("a", 3),
          ^
/home/richel/GitHubs/tres-tidy-tutorial/04_working_with_lists.rmd:504:11: style: Use <-, not =, for assignment.
this_list = split(data, data$order) %>%
          ^
/home/richel/GitHubs/tres-tidy-tutorial/04_working_with_lists.rmd:505:20: style: Opening curly braces should never go on their own line and should always be followed by a new line.
  map(function(df) {split(df, df$iucn_status)})
                   ^
/home/richel/GitHubs/tres-tidy-tutorial/07_programming_in_the_tidyverse.rmd:40:6: style: Use <-, not =, for assignment.
data = read_csv("data/phylacine_traits.csv")
     ^
/home/richel/GitHubs/tres-tidy-tutorial/07_programming_in_the_tidyverse.rmd:43:15: style: Use <-, not =, for assignment.
small_mammals = data %>%
              ^
/home/richel/GitHubs/tres-tidy-tutorial/07_programming_in_the_tidyverse.rmd:49:19: style: Use <-, not =, for assignment.
small_mammals_too = data %>%
                  ^
/home/richel/GitHubs/tres-tidy-tutorial/07_programming_in_the_tidyverse.rmd:125:16: style: Use <-, not =, for assignment.
vars_to_select = c("Mass.g", "Diet.Plant")
               ^
/home/richel/GitHubs/tres-tidy-tutorial/07_programming_in_the_tidyverse.rmd:126:15: style: Use <-, not =, for assignment.
vars_to_group = c("Order.1.2")
              ^
/home/richel/GitHubs/tres-tidy-tutorial/07_programming_in_the_tidyverse.rmd:155:27: style: Put spaces around all infix operators.
  qnorm(1 - (1 - ci / 100)/2) * sd(x, na.rm = TRUE) / sqrt(length(x))
                         ~^~
/home/richel/GitHubs/tres-tidy-tutorial/07_programming_in_the_tidyverse.rmd:223:3: style: Use <-, not =, for assignment.
a = 3
  ^
/home/richel/GitHubs/tres-tidy-tutorial/07_programming_in_the_tidyverse.rmd:247:16: style: Use <-, not =, for assignment.
custom_summary = function(data,
               ^
/home/richel/GitHubs/tres-tidy-tutorial/07_programming_in_the_tidyverse.rmd:251:11: style: Use <-, not =, for assignment.
  filters = rlang::parse_exprs(filters)
          ^
/home/richel/GitHubs/tres-tidy-tutorial/07_programming_in_the_tidyverse.rmd:291:16: style: Use <-, not =, for assignment.
custom_summary = function(data,
               ^
/home/richel/GitHubs/tres-tidy-tutorial/07_programming_in_the_tidyverse.rmd:295:17: style: Use <-, not =, for assignment.
  grouping_vars = rlang::enquos(...)
                ^
/home/richel/GitHubs/tres-tidy-tutorial/07_programming_in_the_tidyverse.rmd:325:16: style: Use <-, not =, for assignment.
custom_summary = function(data,
               ^
/home/richel/GitHubs/tres-tidy-tutorial/07_programming_in_the_tidyverse.rmd:329:17: style: Use <-, not =, for assignment.
  grouping_vars = rlang::syms(grouping_vars)
                ^
/home/richel/GitHubs/tres-tidy-tutorial/07_programming_in_the_tidyverse.rmd:352:16: style: Use <-, not =, for assignment.
custom_summary = function(data,
               ^
/home/richel/GitHubs/tres-tidy-tutorial/07_programming_in_the_tidyverse.rmd:356:17: style: Use <-, not =, for assignment.
  grouping_vars = rlang::parse_exprs(grouping_vars)
                ^
/home/richel/GitHubs/tres-tidy-tutorial/07_programming_in_the_tidyverse.rmd:385:16: style: Use <-, not =, for assignment.
custom_summary = function(data,
               ^
/home/richel/GitHubs/tres-tidy-tutorial/07_programming_in_the_tidyverse.rmd:391:17: style: Use <-, not =, for assignment.
  grouping_vars = rlang::parse_exprs(grouping_vars)
                ^
/home/richel/GitHubs/tres-tidy-tutorial/07_programming_in_the_tidyverse.rmd:418:16: style: Use <-, not =, for assignment.
custom_summary = function(data,
               ^
/home/richel/GitHubs/tres-tidy-tutorial/07_programming_in_the_tidyverse.rmd:423:17: style: Use <-, not =, for assignment.
  grouping_vars = parse_exprs(grouping_vars)
                ^
/home/richel/GitHubs/tres-tidy-tutorial/07_programming_in_the_tidyverse.rmd:423:19: warning: no visible global function definition for ‘parse_exprs’
  grouping_vars = parse_exprs(grouping_vars)
                  ^~~~~~~~~~~
/home/richel/GitHubs/tres-tidy-tutorial/07_programming_in_the_tidyverse.rmd:463:16: style: Use <-, not =, for assignment.
custom_summary = function(data,
               ^
/home/richel/GitHubs/tres-tidy-tutorial/07_programming_in_the_tidyverse.rmd:468:17: style: Use <-, not =, for assignment.
  grouping_vars = rlang::parse_exprs(grouping_vars)
                ^
/home/richel/GitHubs/tres-tidy-tutorial/07_programming_in_the_tidyverse.rmd:471:16: style: Use <-, not =, for assignment.
  summary_vars = rlang::enquos(...)
               ^
/home/richel/GitHubs/tres-tidy-tutorial/07_programming_in_the_tidyverse.rmd:507:16: style: Use <-, not =, for assignment.
custom_summary = function(data,
               ^
/home/richel/GitHubs/tres-tidy-tutorial/07_programming_in_the_tidyverse.rmd:512:17: style: Use <-, not =, for assignment.
  grouping_vars = rlang::parse_exprs(grouping_vars)
                ^
/home/richel/GitHubs/tres-tidy-tutorial/07_programming_in_the_tidyverse.rmd:515:16: style: Use <-, not =, for assignment.
  summary_vars = rlang::enquos(..., .named = TRUE)
               ^
/home/richel/GitHubs/tres-tidy-tutorial/07_programming_in_the_tidyverse.rmd:523:37: style: Only use double-quotes.
  names(summary_vars) <- glue::glue('mean_{names(summary_vars)}')
                                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/richel/GitHubs/tres-tidy-tutorial/07_programming_in_the_tidyverse.rmd:551:16: style: Use <-, not =, for assignment.
custom_summary = function(data,
               ^
/home/richel/GitHubs/tres-tidy-tutorial/07_programming_in_the_tidyverse.rmd:557:17: style: Use <-, not =, for assignment.
  grouping_vars = parse_exprs(grouping_vars)
                ^
/home/richel/GitHubs/tres-tidy-tutorial/07_programming_in_the_tidyverse.rmd:557:19: warning: no visible global function definition for ‘parse_exprs’
  grouping_vars = parse_exprs(grouping_vars)
                  ^~~~~~~~~~~
/home/richel/GitHubs/tres-tidy-tutorial/07_programming_in_the_tidyverse.rmd:563:1: style: Lines should not be more than 80 characters.
  summary_exprs <- parse_exprs(glue::glue('{functions}({summary_vars}, na.rm = TRUE)'))
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/richel/GitHubs/tres-tidy-tutorial/07_programming_in_the_tidyverse.rmd:563:20: warning: no visible global function definition for ‘parse_exprs’
  summary_exprs <- parse_exprs(glue::glue('{functions}({summary_vars}, na.rm = TRUE)'))
                   ^~~~~~~~~~~
/home/richel/GitHubs/tres-tidy-tutorial/07_programming_in_the_tidyverse.rmd:563:43: style: Only use double-quotes.
  summary_exprs <- parse_exprs(glue::glue('{functions}({summary_vars}, na.rm = TRUE)'))
                                          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/richel/GitHubs/tres-tidy-tutorial/07_programming_in_the_tidyverse.rmd:566:38: style: Only use double-quotes.
  names(summary_exprs) <- glue::glue('{functions}_{summary_vars}')
                                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
richelbilderbeek commented 4 years ago

Hi @pratikunterwegs, @rscherrer, @TheoPannetier,

I've run all chapters through lintr, the package that checks for Tidyverse style, above are the suggestions made by it. As this is a Tidyverse tutorial, I feel it is logical to follow the Tidyverse style (note I suggest to add it to Travis CI as well). But maybe you forgot to run the lintr test or used an older version.

Would you enjoy fixing your chapter? If not, would you be OK if I fix your chapter?

richelbilderbeek commented 4 years ago

Tidyverse style guide in bookdown: https://style.tidyverse.org/

rscherrer commented 4 years ago

Hey @richelbilderbeek, we did not run lintr at any time since we started. We see the usefulness of making sure we follow the tidyverse style (I see I have style errors in my tidyr chapter), but I chatted with Pratik and he is not so keen on activating Travis on the repository nor using lintr, because this is a very informal tutorial. So, if you don't mind we'll just leave it like that, no biggie. But thanks for the suggestions! Definitely something to use in our actual work.

richelbilderbeek commented 4 years ago

Hi @rscherrer, sure, I can see the idea of keeping the tutorial informal. And I know that my quality standard may be higher than intended for this tutorial. Therefore I already volunteered to fix the lintr errors. Additionally, I also volunteer to maintain the .travis.yml file (I already do +600 repos, so that will be easy). Or is there a concern that I miss?