Skip to content
New course: Interactive Dashboards with Shiny. Get 50% off with coupon SHINYLAUNCH.
R for the Rest of Us Logo

Create a New Data Frame

This lesson is locked

Get access to all lessons in this course.

Transcript

Click on the transcript to go to that point in the video. Please note that transcripts are auto generated and may contain minor inaccuracies.

Your Turn

Complete the create a new data frame sections of the data-wrangling-and-analysis-exercises.Rmd file.

Learn More

General Data Wrangling and Analysis Resources

Because most material that discusses data wrangling and analysis with the dplyr packges does so in a way that covers all of the verbs discussed in this course, I have chosen not to separate them by lesson. Instead, here are some helpful resources for learning more about all of the tidyverse verbs discussed in this course:

Chapter 5 of R for Data Science

RStudio Cloud primer on working with data

Tidyverse for Beginners by Danielle Navarro

Learning Statistics with R by Danielle Navarro

Introduction to the Tidyverse by Alison Hill

A gRadual intRoduction to data wRangling by Chester Ismay and Ted Laderas

Working in the Tidyverse by Desi Quintans and Jeff Powell

Christine Monnier video tutorials on dplyr

Have any questions? Put them below and we will help you out!

You need to be signed-in to comment on this post. Login.

Abby Isaacson

Abby Isaacson

March 31, 2021

when I try this simple renaming, I get the error (below code): mental_health_over_30 % filter(age >= 30) %>% group_by(gender) %>% summarize(mean_bad_mental_health_days = mean(days_ment_hlth_bad, na.rm = TRUE)) %>% mutate(mean_bad_mental_health_days = round(mean_bad_mental_health_days, digits = 1)) %>% arrange(desc(mean_bad_mental_health_days)) summarise() ungrouping output (override with .groups argument)

Abby Isaacson

Abby Isaacson

March 31, 2021

correction in code, still error: mental_health_over_30 % filter(age >= 30) %>% group_by(gender) %>% summarize(mean_bad_mental_health_days = mean(days_ment_hlth_bad, na.rm = TRUE)) %>% mutate(mean_bad_mental_health_days = round(mean_bad_mental_health_days, digits = 1)) %>% arrange(desc(mean_bad_mental_health_days))

Abby Isaacson

Abby Isaacson

March 31, 2021

well apparently, cutting and pasting the top line doesn't show up as normal. mental_health_over_30 % is the first line

Abby Isaacson

Abby Isaacson

March 31, 2021

ah! It did it again, when I publish it removes the nhanes and pipe line

David Keyes

David Keyes

March 31, 2021

No worries on the copying and pasting not working. This is not an error, just an informational message. If you want to learn more, I made a video about it. We'll also talk about it on Thursday.