Skip to content

Commit

Permalink
fix lintr checks
Browse files Browse the repository at this point in the history
  • Loading branch information
avallecam committed Sep 13, 2024
1 parent 7d6df35 commit 13c0dba
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions episodes/clean-data.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,7 @@ linelist::make_linelist(
date_onset = "date_onset",
gender = "gender",
age = "age", # same name in default list and dataset
date_reporting = "date_sample", # different names but related
date_reporting = "date_sample" # different names but related
)
```

Expand Down Expand Up @@ -386,7 +386,7 @@ Let's test the implications of changing the **safeguarding** configuration from

```{r,eval=FALSE}
data %>%
dplyr::select(case_id, gender) %>%
dplyr::select(case_id, gender) %>%
dplyr::count(gender)
```

Expand Down Expand Up @@ -441,7 +441,7 @@ Identify the correlation between the error messages and the output of `linelist:
If we change the `age` variable from numeric to character:

```{r,eval=TRUE,message=FALSE,warning=FALSE}
library(tidyverse) # for {dplyr} functions and the pipe %>%
library(tidyverse) # for {dplyr} functions and the pipe %>%
```


Expand Down Expand Up @@ -474,28 +474,28 @@ Run these examples and answer: Why are we getting an error message?

```{r,eval=FALSE}
# example 2
cleaned_data %>%
cleaned_data %>%
# simulate a change of data type
dplyr::mutate(date_onset_character = as.character(date_onset)) %>%
dplyr::mutate(date_onset_character = as.character(date_onset)) %>%
# tag
linelist::make_linelist(
date_onset = "date_onset_character"
) %>%
) %>%
# validate
linelist::validate_linelist()
```


```{r,eval=FALSE}
# example 3
cleaned_data %>%
cleaned_data %>%
# simulate a change of data type
dplyr::mutate(gender = as.factor(gender)) %>%
dplyr::mutate(gender_integer = as.integer(gender)) %>%
dplyr::mutate(gender = as.factor(gender)) %>%
dplyr::mutate(gender_integer = as.integer(gender)) %>%
# tag
linelist::make_linelist(
gender = "gender_integer"
) %>%
) %>%
# validate
linelist::validate_linelist()
```
Expand Down

0 comments on commit 13c0dba

Please sign in to comment.