Skip to content

Commit

Permalink
Suggest/data-import.qmd (#1659)
Browse files Browse the repository at this point in the history
* probably a typo, and no mention about fixing `student_id` column below.

* "and" is better than "so"
  • Loading branch information
mitsuoxv authored May 28, 2024
1 parent 43ee557 commit c70b13b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions data-import.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ students

In the `favourite.food` column, there are a bunch of food items, and then the character string `N/A`, which should have been a real `NA` that R will recognize as "not available".
This is something we can address using the `na` argument.
By default, `read_csv()` only recognizes empty strings (`""`) in this dataset as `NA`s, we want it to also recognize the character string `"N/A"`.
By default, `read_csv()` only recognizes empty strings (`""`) in this dataset as `NA`s, and we want it to also recognize the character string `"N/A"`.

```{r}
#| message: false
Expand Down Expand Up @@ -131,7 +131,7 @@ students |>
Note that the values in the `meal_plan` variable have stayed the same, but the type of variable denoted underneath the variable name has changed from character (`<chr>`) to factor (`<fct>`).
You'll learn more about factors in @sec-factors.

Before you analyze these data, you'll probably want to fix the `age` and `id` columns.
Before you analyze these data, you'll probably want to fix the `age` column.
Currently, `age` is a character variable because one of the observations is typed out as `five` instead of a numeric `5`.
We discuss the details of fixing this issue in @sec-import-spreadsheets.

Expand Down

0 comments on commit c70b13b

Please sign in to comment.