Skip to content

Commit

Permalink
intro bug hunt r
Browse files Browse the repository at this point in the history
  • Loading branch information
trevorcampbell committed Dec 23, 2023
1 parent a66fd2f commit 9411ecd
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion _bookdown.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ language:
ui:
edit: "Edit"
chapter_name: "Chapter "
rmd_files: ["index.Rmd", "source/foreword.Rmd", "source/preface.Rmd", "source/acknowledgments.Rmd", "source/authors.Rmd", "source/intro.Rmd", "source/reading.Rmd", "source/wrangling.Rmd", "source/viz.Rmd", "source/classification1.Rmd", "source/classification2.Rmd", "source/regression1.Rmd", "source/regression2.Rmd", "source/clustering.Rmd", "source/inference.Rmd", "source/jupyter.Rmd", "source/version-control.Rmd", "source/setup.Rmd", "source/references.Rmd"]
rmd_files: ["index.Rmd", "source/intro.Rmd", "source/references.Rmd"]
8 changes: 4 additions & 4 deletions source/intro.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ library(tidyverse)
```

> **Note:** You may have noticed that we got some extra
> output from R saying `Attaching packages` and `Conflicts` below our code
> output from R regarding attached packages and conflicts below our code
> line. These are examples of *messages* in R, which give the user more
> information that might be handy to know. The `Attaching packages` message is
> natural when loading `tidyverse`, since `tidyverse` actually automatically
Expand Down Expand Up @@ -452,7 +452,7 @@ selected_lang <- select(aboriginal_lang, language, mother_tongue)
selected_lang
```

## Using `arrange` to order and `slice` to select rows by index number
## Using `arrange` to order and `slice` to select rows by index number {#arrangesliceintro}

We have used `filter` and `select` to obtain a table with only the Aboriginal
languages in the data set and their associated counts. However, we want to know
Expand Down Expand Up @@ -500,7 +500,7 @@ counts... But perhaps, seeing these numbers, we became curious about the
*percentage* of the population of Canada associated with each count. It is
common to come up with new data analysis questions in the process of answering
a first one&mdash;so fear not and explore! To answer this small
question-along-the-way, we need to divide each count in the `mother_tongue`
question along the way, we need to divide each count in the `mother_tongue`
column by the total Canadian population according to the 2016
census&mdash;i.e., 35,151,728&mdash;and multiply it by 100. We can perform
this computation using the `mutate` function. We pass the `ten_lang`
Expand All @@ -523,7 +523,7 @@ as a mother tongue by between 0.008% and 0.18% of the Canadian population.

## Exploring data with visualizations

We have now answered our initial question by generating the `ten_lang` table!
The `ten_lang` table we generated in Section \@ref(arrangesliceintro) answers our initial data analysis question.
Are we done? Well, not quite; tables are almost never the best way to present
the result of your analysis to your audience. Even the `ten_lang` table with
only two columns presents some difficulty: for example, you have to scrutinize
Expand Down

0 comments on commit 9411ecd

Please sign in to comment.