Skip to content

Commit a97d189

Browse files
committed
adjust linting requirement
1 parent 9e90e3f commit a97d189

File tree

6 files changed

+19
-17
lines changed

6 files changed

+19
-17
lines changed

.lintr

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@ linters: all_linters(
66
missing_package_linter = NULL,
77
library_call_linter = NULL,
88
namespace_linter = NULL,
9-
one_call_pipe_linter = NULL,
9+
#one_call_pipe_linter = NULL,
1010
unused_import_linter = NULL,
11-
consecutive_mutate_linter = NULL,
12-
nrow_subset_linter = NULL,
13-
return_linter = NULL,
11+
#consecutive_mutate_linter = NULL,
12+
#nrow_subset_linter = NULL,
13+
#return_linter = NULL,
1414
cyclocomp_linter = NULL,
1515
undesirable_function_linter(
1616
modify_defaults(
@@ -19,3 +19,4 @@ linters: all_linters(
1919
)
2020
)
2121
)
22+

README.Rmd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ output: github_document
55
<!-- README.md is generated from README.Rmd. Please edit that file -->
66

77
```{r, include = FALSE}
8-
knitr::opts_chunk$set(
8+
knitr::opts_chunk[[set]](
99
collapse = TRUE,
1010
comment = "#>"
1111
)

episodes/clean-data.Rmd

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -50,12 +50,12 @@ the advantages of using this.
5050

5151
```{r, eval=TRUE, message=FALSE, warning=FALSE}
5252
# Check if a package is already installed and install it if not
53-
if (!require("pak")) install.packages("pak")
54-
if (!require("here")) pak::pak("here")
55-
if (!require("rio")) pak::pak("rio")
56-
if (!require("dplyr")) pak::pak("dplyr")
57-
if (!require("magrittr")) pak::pak("magrittr")
58-
if (!require("cleanepi")) pak::pak("cleanepi")
53+
if (!requireNamespace("pak", quietly = TRUE)) install.packages("pak")
54+
if (!requireNamespace("here", quietly = TRUE)) pak::pak("here")
55+
if (!requireNamespace("rio", quietly = TRUE)) pak::pak("rio")
56+
if (!requireNamespace("dplyr", quietly = TRUE)) pak::pak("dplyr")
57+
if (!requireNamespace("magrittr", quietly = TRUE)) pak::pak("magrittr")
58+
if (!requireNamespace("cleanepi", quietly = TRUE)) pak::pak("cleanepi")
5959
6060
# load the packages
6161
library(here)
@@ -296,7 +296,8 @@ particular way. These IDs can contain numbers falling within a specific range, a
296296

297297

298298
```{r}
299-
# check if the subject IDs in the 'case_id' column contains numbers ranging from 0 to 15000
299+
# check if the subject IDs in the 'case_id' column contains numbers ranging
300+
# from 0 to 15000
300301
sim_ebola_data <- cleanepi::check_subject_ids(
301302
data = sim_ebola_data,
302303
target_columns = "case_id",

episodes/describe-cases.Rmd

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -273,8 +273,8 @@ The example below demonstrates how to configure these three elements for a simpl
273273
```{r}
274274
# Define date breaks for the x-axis
275275
breaks <- seq.Date(
276-
from = min(as.Date(daily_incidence$date_index, na.rm = TRUE)),
277-
to = max(as.Date(daily_incidence$date_index, na.rm = TRUE)),
276+
from = min(as.Date(daily_incidence[[date_index]], na.rm = TRUE)),
277+
to = max(as.Date(daily_incidence[[date_index]], na.rm = TRUE)),
278278
by = 20 # every 20 days
279279
)
280280

episodes/read-cases.Rmd

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ A real-life connection to an external SQLite database would look like this:
187187
```{r}
188188
# in real-life
189189
db_connection <- DBI::dbConnect(
190-
RSQLite::SQLite(),
190+
RSQLite::SQLite(),
191191
host = "database.epiversetrace.com",
192192
user = "juanito",
193193
password = epiversetrace::askForPassword("Database password")
@@ -234,7 +234,7 @@ mytable_db <- dplyr::tbl(src = db_connection, "cases")
234234
If we apply `{dplyr}` verbs to this table of a SQLite database, these verbs will be translated to an SQL queries.
235235

236236
```{r}
237-
# Show the translated SQL queries
237+
# Show the translated SQL queries
238238
mytable_db %>%
239239
dplyr::filter(confirm > 50) %>%
240240
dplyr::arrange(desc(confirm)) %>%

episodes/simple-analysis.Rmd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ covid19_eng_case_data <- outbreaks::covid19_england_nhscalls_2020
4242
# subset the covid19_eng_case_data to include only the first 3 months of data
4343
df <- base::subset(
4444
covid19_eng_case_data,
45-
covid19_eng_case_data$date <= min(covid19_eng_case_data$date) + 90
45+
covid19_eng_case_data[[date]] <= min(covid19_eng_case_data[[date]]) + 90
4646
)
4747
4848
# uses the incidence() function from the {incidence2} package to compute the

0 commit comments

Comments
 (0)