Skip to content

Commit 4041988

Browse files
changed intro end figure to get rid of white bkg, blue bars
1 parent 14dac93 commit 4041988

File tree

1 file changed

+5
-9
lines changed

1 file changed

+5
-9
lines changed

intro.Rmd

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -612,13 +612,10 @@ n.o.s. with over 60,000 Canadian residents reporting it as their mother tongue.
612612
### Putting it all together
613613

614614
In the block of code below, we put everything from this chapter together, with a few
615-
modifications. In particular, we have
616-
added a few more layers to make the data visualization even more effective.
617-
Specifically, we changed the color of the bars and changed the background from
618-
grey to white to improve the contrast. We have also actually skipped the
615+
modifications. In particular, we have actually skipped the
619616
`select` step that we did above; since you specify the variable names to plot
620617
in the `ggplot` function, you don't actually need to `select` the columns in advance
621-
when creating a visualization. And finally, we provided *comments* next to
618+
when creating a visualization. We have also provided *comments* next to
622619
many of the lines of code below using the
623620
hash symbol `#`. When R sees a `#` sign, \index{comment} \index{aaacommentsymb@\#|see{comment}} it
624621
will ignore all of the text that
@@ -641,17 +638,16 @@ ten_lang <- slice(arranged_lang, 1:10)
641638
# create the visualization
642639
ggplot(ten_lang, aes(x = mother_tongue,
643640
y = reorder(language, mother_tongue))) +
644-
geom_bar(stat = "identity", fill = "steelblue") +
641+
geom_bar(stat = "identity") +
645642
xlab("Mother Tongue (Number of Canadians, 2016 Census)") +
646-
ylab("Language") +
647-
theme_bw() # use a theme to have a white background
643+
ylab("Language")
648644
```
649645

650646
This exercise demonstrates the power of R. In relatively few lines of code, we
651647
performed an entire data science workflow with a highly effective data
652648
visualization! We asked a question, loaded the data into R, wrangled the data
653649
(using `filter`, `arrange` and `slice`) and created a data visualization to
654-
help answer our question. In this chapter, you got a quick taste of the data
650+
help answer our question. In this chapter, you got a quick taste of the data
655651
science workflow; continue on with the next few chapters to learn each of
656652
these steps in much more detail!
657653

0 commit comments

Comments
 (0)