Skip to content

Commit

Permalink
Merge pull request #502 from e-clin/patch-4
Browse files Browse the repository at this point in the history
Update 04-tidy.Rmd
  • Loading branch information
ismayc authored Jul 23, 2024
2 parents 1f1814c + fa9b363 commit 11d2050
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions 04-tidy.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,7 @@ You can also view examples of both `pivot_longer()` and `pivot_wider()` on the [
airline_safety
```

After reading the help file by running `?airline_safety`, we see that `airline_safety` is a data frame containing information on different airline companies' safety records. This data was originally reported on the data journalism website, FiveThirtyEight.com, in Nate Silver's article, ["Should Travelers Avoid Flying Airlines That Have Had Crashes in the Past?"](https://fivethirtyeight.com/features/should-travelers-avoid-flying-airlines-that-have-had-crashes-in-the-past/). Let's only consider the variables `airlines` and those relating to fatalities for simplicity:
After reading the help file by running `?airline_safety`, we see that `airline_safety` is a data frame containing information on different airline companies' safety records. This data was originally reported on the data journalism website, FiveThirtyEight.com, in Nate Silver's article, ["Should Travelers Avoid Flying Airlines That Have Had Crashes in the Past?"](https://fivethirtyeight.com/features/should-travelers-avoid-flying-airlines-that-have-had-crashes-in-the-past/). Let's only consider the variables `airline` and those relating to fatalities for simplicity:

```{r}
airline_safety_smaller <- airline_safety %>%
Expand Down Expand Up @@ -547,7 +547,7 @@ if (is_latex_output()) {
generate_r_file_link("04-tidy.R")
```

If you want to learn more about using the `readr` and `tidyr` package, we suggest that you check out RStudio's "Data Import Cheat Sheet." In the current version of RStudio in late 2019, you can access this cheatsheet by going to the RStudio Menu Bar -> Help -> Cheatsheets -> "Browse Cheatsheets" -> Scroll down the page to the "Data Import Cheat Sheet." The first page of this cheatsheet has information on using the `readr` package to import data, while the second page has information on using the `tidyr` package to "tidy" data. `r if(is_html_output()) "You can see a preview of both cheatsheets in the figures below."`
If you want to learn more about using the `readr` and `tidyr` package, we suggest that you check out RStudio's "Data Import Cheat Sheet." In the current version of RStudio in mid 2024, you can access this cheatsheet by going to the RStudio Menu Bar -> Help -> Cheat Sheets -> "Browse Cheat Sheets..." -> Scroll down the page to the "Data import with reader, readxl, and googlesheets4..." for information on using the `readr`, `readxl` and `googlesheets4` packages to import data, and the "Data tidying with tidyr cheatsheet" for information on using the `tidyr` package to "tidy" data. `r if(is_html_output()) "You can see a preview of both cheatsheets in the figures below."`

```{r import-cheatsheet, echo=FALSE, fig.cap="Data Import cheatsheet (first page): readr package.", out.width="66%", purl=FALSE}
if (is_html_output()) {
Expand Down

0 comments on commit 11d2050

Please sign in to comment.