Skip to content

Commit 85ada93

Browse files
committed
some code formatting fixes
1 parent bb3dfe0 commit 85ada93

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

viz.Rmd

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -491,6 +491,8 @@ And is there a pattern in the strength of this relationship in the
491491
higher-level language categories (Official languages, Aboriginal languages, or
492492
non-official and non-Aboriginal languages)?
493493

494+
To get started, we will read and inspect the data:
495+
494496
```{r 03-canlang-example, message = F, warning = F}
495497
can_lang <- read_csv("data/can_lang.csv")
496498
can_lang
@@ -622,8 +624,8 @@ you can clearly see the mutated output from the table.
622624
```{r}
623625
can_lang <- can_lang |>
624626
mutate(
625-
mother_tongue_percent = (mother_tongue / 35151728)*100,
626-
most_at_home_percent = (most_at_home / 35151728)*100
627+
mother_tongue_percent = (mother_tongue / 35151728) * 100,
628+
most_at_home_percent = (most_at_home / 35151728) * 100
627629
)
628630
629631
can_lang |>
@@ -693,7 +695,9 @@ color the points according to their group and add a legend at the side of the
693695
plot.
694696

695697
```{r 03-scatter-color-by-category, fig.width=7.75, fig.height=4, warning=FALSE, fig.cap = "Scatter plot of percentage of Canadians reporting a language as their mother tongue vs the primary language at home colored by language category"}
696-
ggplot(can_lang, aes(x = most_at_home_percent, y = mother_tongue_percent, color = category)) +
698+
ggplot(can_lang, aes(x = most_at_home_percent,
699+
y = mother_tongue_percent,
700+
color = category)) +
697701
geom_point() +
698702
labs(x = "Language spoken most at home \n (percentage of Canadian residents)",
699703
y = "Mother tongue \n (percentage of Canadian residents)") +
@@ -735,7 +739,8 @@ further improve the clarity and accessibility of your visualization.
735739
```{r scatter-color-by-category-palette, fig.width=7.75, fig.height=4, warning=FALSE, fig.cap = "Scatter plot of percentage of Canadians reporting a language as their mother tongue vs the primary language at home colored by language category with color-blind friendly colors"}
736740
ggplot(can_lang, aes(x = most_at_home_percent,
737741
y = mother_tongue_percent,
738-
color = category, shape = category)) +
742+
color = category,
743+
shape = category)) +
739744
geom_point() +
740745
labs(x = "Language spoken most at home \n (percentage of Canadian residents)",
741746
y = "Mother tongue \n (percentage of Canadian residents)") +
@@ -830,6 +835,8 @@ islands_df <- mutate(islands_df,
830835
write_csv(islands_df, "data/islands.csv")
831836
```
832837

838+
To get started, we will read and inspect the data:
839+
833840
```{r 03-data-islands, warning=FALSE, message=FALSE}
834841
# islands data
835842
islands_df <- read_csv("data/islands.csv")

0 commit comments

Comments
 (0)