Fix col types, remove irrelevant bit, closes #1450
This commit is contained in:
parent
ee2b654a55
commit
057966a4a9
|
@ -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.
|
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}
|
```{r}
|
||||||
#| echo: false
|
#| 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(
|
mutate(
|
||||||
n_pets = case_when(
|
n_pets = case_when(
|
||||||
n_pets == "none" ~ "0",
|
n_pets == "none" ~ "0",
|
||||||
|
|
Loading…
Reference in New Issue