diff --git a/.Rhistory b/.Rhistory deleted file mode 100644 index e69de29b..00000000 diff --git a/.here b/.here deleted file mode 100644 index e69de29b..00000000 diff --git a/03-dplyr.md b/03-dplyr.md index 0259cb67..3e551a0b 100644 --- a/03-dplyr.md +++ b/03-dplyr.md @@ -167,6 +167,10 @@ filter(interviews, village == "Chirodzo") # instanceID ``` +You may also have noticed that the output from these call doesn't run off the +screen anymore. It's one of the advantages of `tbl_df` (also called tibble), +the central data class in the tidyverse, compared to normal dataframes in R. + We can also specify multiple conditions within the `filter()` function. We can combine conditions using either "and" or "or" statements. In an "and" statement, an observation (row) must meet **every** criteria to be included @@ -555,9 +559,6 @@ interviews %>% 3 Ruaca 7.57 ``` -You may also have noticed that the output from these calls doesn't run off the -screen anymore. It's one of the advantages of `tbl_df` over dataframe. - You can also group by multiple columns: @@ -588,7 +589,9 @@ interviews %>% 9 Ruaca 6.22 ``` -Note that the output is a grouped tibble. To obtain an ungrouped tibble, use the +Note that the output is a grouped tibble of nine rows by three columns +which is indicated by the by two first lines with the `#`. +To obtain an ungrouped tibble, use the `ungroup` function: @@ -619,6 +622,8 @@ interviews %>% 9 Ruaca 6.22 ``` +Notice that the second line with the `#` that previously indicated the grouping has +disappeared and we now only have a 9x3-tibble without grouping. When grouping both by `village` and `membr_assoc`, we see rows in our table for respondents who did not specify whether they were a member of an irrigation association. We can exclude those data from our table using a filter step. diff --git a/md5sum.txt b/md5sum.txt index 874df967..02b60195 100644 --- a/md5sum.txt +++ b/md5sum.txt @@ -6,7 +6,7 @@ "episodes/00-intro.Rmd" "55b4f07dc0323cb819256954954ec242" "site/built/00-intro.md" "2024-11-19" "episodes/01-intro-to-r.Rmd" "e6038b5b8156ba5036aa08878d24c370" "site/built/01-intro-to-r.md" "2024-11-19" "episodes/02-starting-with-data.Rmd" "6217dcc0ad4be665633300c51665f35c" "site/built/02-starting-with-data.md" "2024-11-19" -"episodes/03-dplyr.Rmd" "9d624d21108a73be97259938d97f3458" "site/built/03-dplyr.md" "2024-11-19" +"episodes/03-dplyr.Rmd" "4780930e7533e5ae34ec0520f462cd38" "site/built/03-dplyr.md" "2024-11-29" "episodes/04-tidyr.Rmd" "ac03030af6b9247b199c9bc29f2916a2" "site/built/04-tidyr.md" "2024-11-19" "episodes/05-ggplot2.Rmd" "03ae0a2f69b9b9eb7822c1b33462bd3c" "site/built/05-ggplot2.md" "2024-11-19" "episodes/06-rmarkdown.Rmd" "0d414fd9c037f1a3a78b1cae5e2708b6" "site/built/06-rmarkdown.md" "2024-11-19"