Fix col types, remove irrelevant bit, closes #1450

This commit is contained in:
mine-cetinkaya-rundel 2023-05-09 23:23:38 -04:00
parent ee2b654a55
commit 057966a4a9
1 changed files with 1 additions and 2 deletions

View File

@ -407,12 +407,11 @@ A good way of familiarizing yourself with the coding style used in a new package
```
Then, read it into R, with `survey_id` as a character variable and `n_pets` as a numerical variable.
Hint: You will need to convert "none" to 0.
```{r}
#| echo: false
read_excel("data/survey.xlsx", na = c("", "N/A")) |>
read_excel("data/survey.xlsx", na = c("", "N/A"), col_types = c("text", "text")) |>
mutate(
n_pets = case_when(
n_pets == "none" ~ "0",