Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace use of rowsums in tidyr episode #535

Merged
merged 6 commits into from
Nov 6, 2024

Conversation

jessesadler
Copy link
Contributor

Close #531

  • Use grouped mutate() instead of rowSums() to create summary columns. This is more in line with tidyverse usage and fixes a mistake in lesson where no household was shown to have 0 items.
  • Explain use of grouped mutate() and dplyr if_else() function.
  • Create new exercise to do the same with months lacking food.
  • Remove exercise in pivot longer that replicated earlier calculations in a confusing manner.
  • Change code to recreate interviews_plotting in ggplot2 episode using new method.
  • Change interviews_plotting data using new method.

* Remove use of rowSums() and explain use of grouped mutate() and use of if_else().
* Reflowed some of the text
* Add exercise to create months_lack_food dataframe
* Removed exercise under Pivot Longer section that redid earlier summary of items owned.
Copy link

github-actions bot commented Oct 15, 2024

Thank you!

Thank you for your pull request 😃

🤖 This automated message can help you check the rendered files in your submission for clarity. If you have any questions, please feel free to open an issue in {sandpaper}.

If you have files that automatically render output (e.g. R Markdown), then you should check for the following:

  • 🎯 correct output
  • 🖼️ correct figures
  • ❓ new warnings
  • ‼️ new errors

Rendered Changes

🔍 Inspect the changes: https://github.com/datacarpentry/r-socialsci/compare/md-outputs..md-outputs-PR-535

The following changes were observed in the rendered markdown documents:

 04-tidyr.md                                        |  195 +--
 05-ggplot2.md                                      |   30 +-
 config.yaml (new)                                  |   88 ++
 data/download_data.R                               |   30 +-
 data/interviews_plotting.csv                       |  264 ++--
 data_output/interviews_plotting.csv                |  264 ++--
 fig/05-ggplot2-rendered-adding-colors-1.png        |  Bin 17962 -> 19084 bytes
 fig/05-ggplot2-rendered-adding-jitter-1.png        |  Bin 9303 -> 9196 bytes
 fig/05-ggplot2-rendered-adding-transparency-1.png  |  Bin 7238 -> 7415 bytes
 fig/05-ggplot2-rendered-adding-width-height-1.png  |  Bin 8822 -> 9551 bytes
 fig/05-ggplot2-rendered-boxplot-exercise-1.png     |  Bin 10201 -> 10384 bytes
 ...-ggplot2-rendered-boxplot-exercise-factor-1.png |  Bin 21349 -> 21447 bytes
 fig/05-ggplot2-rendered-boxplot-with-jitter-1.png  |  Bin 16516 -> 17393 bytes
 fig/05-ggplot2-rendered-color-by-species-1.png     |  Bin 19994 -> 20677 bytes
 ...5-ggplot2-rendered-color-by-species-notes-1.png |  Bin 20542 -> 20526 bytes
 fig/05-ggplot2-rendered-create-ggplot-object-1.png |  Bin 6952 -> 7004 bytes
 fig/05-ggplot2-rendered-first-ggplot-1.png         |  Bin 6952 -> 7004 bytes
 fig/05-ggplot2-rendered-scatter-challenge-1.png    |  Bin 18845 -> 19327 bytes
 fig/05-ggplot2-rendered-violin-plot-1.png          |  Bin 27620 -> 28135 bytes
 md5sum.txt                                         |    4 +-
 renv.lock (new)                                    | 1563 ++++++++++++++++++++
 21 files changed, 2060 insertions(+), 378 deletions(-)
What does this mean?

If you have source files that require output and figures to be generated (e.g. R Markdown), then it is important to make sure the generated figures and output are reproducible.

This output provides a way for you to inspect the output in a diff-friendly manner so that it's easy to see the changes that occur due to new software versions or randomisation.

⏱️ Updated at 2024-11-06 20:39:37 +0000

github-actions bot pushed a commit that referenced this pull request Oct 15, 2024
github-actions bot pushed a commit that referenced this pull request Oct 29, 2024
episodes/04-tidyr.Rmd Outdated Show resolved Hide resolved
Copy link
Contributor

@juanfung juanfung left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great! Approve contingent on fixing the one minor typo (left a comment on line 393 of 04-tidyr.Rmd.

github-actions bot pushed a commit that referenced this pull request Nov 6, 2024
Copy link
Contributor

@juanfung juanfung left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not clear if this is approving the update but...approve!

@juanfung juanfung merged commit 216d1df into datacarpentry:main Nov 6, 2024
3 checks passed
github-actions bot pushed a commit that referenced this pull request Nov 6, 2024
Auto-generated via `{sandpaper}`
Source  : 216d1df
Branch  : main
Author  : Juan Fung <[email protected]>
Time    : 2024-11-06 20:47:09 +0000
Message : Merge pull request #535 from jessesadler/rowsums

Replace use of rowsums in tidyr episode
github-actions bot pushed a commit that referenced this pull request Nov 6, 2024
Auto-generated via `{sandpaper}`
Source  : eea7e36
Branch  : md-outputs
Author  : GitHub Actions <[email protected]>
Time    : 2024-11-06 20:48:43 +0000
Message : markdown source builds

Auto-generated via `{sandpaper}`
Source  : 216d1df
Branch  : main
Author  : Juan Fung <[email protected]>
Time    : 2024-11-06 20:47:09 +0000
Message : Merge pull request #535 from jessesadler/rowsums

Replace use of rowsums in tidyr episode
github-actions bot pushed a commit that referenced this pull request Nov 12, 2024
Auto-generated via `{sandpaper}`
Source  : eea7e36
Branch  : md-outputs
Author  : GitHub Actions <[email protected]>
Time    : 2024-11-06 20:48:43 +0000
Message : markdown source builds

Auto-generated via `{sandpaper}`
Source  : 216d1df
Branch  : main
Author  : Juan Fung <[email protected]>
Time    : 2024-11-06 20:47:09 +0000
Message : Merge pull request #535 from jessesadler/rowsums

Replace use of rowsums in tidyr episode
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Replace use of rowSums() to create summary columns in tidyr episode
2 participants