From 72d0114481c1421baffe754c57bd7223cc706e6c Mon Sep 17 00:00:00 2001 From: gungorMetehan <102655648+gungorMetehan@users.noreply.github.com> Date: Mon, 12 Feb 2024 16:22:19 +0300 Subject: [PATCH] Update 93-appendixC.Rmd 5 typos --- 93-appendixC.Rmd | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/93-appendixC.Rmd b/93-appendixC.Rmd index 3180cd9a9..7746055f7 100755 --- a/93-appendixC.Rmd +++ b/93-appendixC.Rmd @@ -8,7 +8,7 @@ Let's load all the packages needed for this chapter (this assumes you've already * `dplyr` for data wrangling * `tidyr` for converting data to "tidy" format * `readr` for importing spreadsheet data into R -* As well as the more advanced `purrr`, `tibble`, `stringr`, and `forcats` packages +* As well as the more advanced `purrr`, `tibble`, `stringr`, and `forcats` packages. If needed, read Section \@ref(packages) for information on how to install and load R packages. @@ -128,7 +128,7 @@ ggplot(revenue_by_type, aes(x = type, y = total_revenue)) + labs(x = "Movie genre", y = "Total boxoffice revenue (in millions of $)") ``` -Or if you want to reorder `type` in ascending order of `total_revenue`, we use `reorder()` +Or if you want to reorder `type` in ascending order of `total_revenue`, we use `reorder()`: ```{r} revenue_by_type <- revenue_by_type %>% @@ -156,7 +156,7 @@ ggplot(revenue_by_type, aes(x = type, y = total_revenue)) + ``` For more advanced categorical variable (i.e. factor) manipulations, check out -the [`forcats` package](https://forcats.tidyverse.org/){target="_blank"}. Note: `forcats` is an anagram of `factors` +the [`forcats` package](https://forcats.tidyverse.org/){target="_blank"}. Note: `forcats` is an anagram of `factors`. ![](https://github.com/tidyverse/forcats/blob/main/man/figures/logo.png?raw=true){width=20%} @@ -204,7 +204,7 @@ movies_ex %>% slice(1:10) ``` -Do the same here, but return `"not romantic comedy"` if `type` is not `"rom comedy"` and this time overwrite the original `type` variable +Do the same here, but return `"not romantic comedy"` if `type` is not `"rom comedy"` and this time overwrite the original `type` variable: ```{r} movies_ex %>% @@ -316,7 +316,7 @@ So for example, the 4 proportions corresponding to R rated movies are 0.596 + 0. ### Dealing with %, commas, and \$ {#appendix-commas} -Say you have numerical data that are recorded as percentages, have commas, or are in dollar form and hence are character strings. How do you convert these to numerical values? Using the `parse_number()` function from the `readr` package inside a `mutate()`! Shout out to [Stack Overflow](https://stackoverflow.com/a/52965808/3674500){target="_blank"} +Say you have numerical data that are recorded as percentages, have commas, or are in dollar form and hence are character strings. How do you convert these to numerical values? Using the `parse_number()` function from the `readr` package inside a `mutate()`! Shout out to [Stack Overflow](https://stackoverflow.com/a/52965808/3674500){target="_blank"}. ```{r} library(readr)