From 057966a4a96e9f176f21c78a3c8017d6b4034b30 Mon Sep 17 00:00:00 2001 From: mine-cetinkaya-rundel Date: Tue, 9 May 2023 23:23:38 -0400 Subject: [PATCH] Fix col types, remove irrelevant bit, closes #1450 --- spreadsheets.qmd | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/spreadsheets.qmd b/spreadsheets.qmd index dd48a73..2fa68c8 100644 --- a/spreadsheets.qmd +++ b/spreadsheets.qmd @@ -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",