Get access to all lessons in this course.
-
Week 1: Getting Started with R
- Welcome to Getting Started with R
- Install R
- Install RStudio
- Projects
- Files in R
- Packages
- Import Data
- Objects and Functions
- Examine our Data
- Import Our Data Again
- Getting Help
- Wrapping Up
- R in 3 Months Spring 2022 Week 1 Live Session
-
Week 2: Fundamentals of R (RMarkdown)
- Welcome to Fundamentals of R
- RMarkdown Overview
- YAML
- Text
- Code Chunks
- Wrapping Up
- R in 3 Months Spring 2022 Week 2 Project Assignment
- R in 3 Months Spring 2022 Week 2 Office Hours
- R in 3 Months Spring 2022 Week 2 Live Session
-
Week 3: Fundamentals of R (Data Wrangling and Analysis)
- Getting Started
- The Tidyverse
- select
- mutate
- filter
- summarize
- group_by
- count
- arrange
- Create a New Data Frame
- Crosstabs
- Wrapping Up
- R in 3 Months Spring 2022 Week 3 Office Hours
- R in 3 Months Spring 2022 Week 3 Live Session
- R in 3 Months Spring 2022 Week 3 Project Assignment
-
Week 4: Fundamentals of R (Data Visualization)
- An Important Workflow Tip
- The Grammar of Graphics
- Scatterplots
- Histograms
- Bar Charts
- color and fill
- scales
- Text and Labels
- Plot Labels
- Themes
- Facets
- Save Plots
- Wrapping Up
- You Did It!
- R in 3 Months Spring 2022 Week 4 Office Hours
- R in 3 Months Spring 2022 Week 4 Live Session
- R in 3 Months Spring 2022 Week 4 Project Assignment
-
Week 5: Catch-Up Week
- R in 3 Months Spring 2022 Week 5 Office Hours
- R in 3 Months Spring 2022 Week 5 Project Assignment: ASSIGNMENT AMNESTY
-
Week 6: Git + GitHub
- What is Git? What is GitHub?
- Why Should You Learn to Use Git and GitHub?
- Update Everything
- Install Git
- Configure Git
- Create a Local Git Repository
- Commits
- Commit History
- GitHub Repositories
- Connect RStudio and GitHub
- Push an RStudio Project to a GitHub Repository
- Pull a GitHub Repository to an RStudio Project
- Keep RStudio and GitHub in Sync
- R in 3 Months Spring 2022 Week 6 Office Hours
- R in 3 Months Spring 2022 Week 6 Live Session
- R in 3 Months Spring 2022 Week 6 Project Assignment
-
Week 7: Going Deeper with R (Advanced Data Wrangling, Part 1)
- Overview
- Importing Data
- Tidy Data
- Reshaping Data
- Dealing with Missing Data
- Changing Variable Types
- Advanced Variable Creation
- Advanced Summarizing
- Binding Data Frames
- R in 3 Months Spring 2022 Week 7 Office Hours
- R in 3 Months Spring 2022 Week 7 Project Assignment
- R in 3 Months Spring 2022 Week 7 Live Session
-
Week 8: Going Deeper with R (Advanced Data Wrangling, Part 2)
- Functions
- Merging Data
- Renaming Variables
- Quick Interlude to Reorganize our Code
- Exporting Data
- R in 3 Months Spring 2022 Week 8 Office Hours
- R in 3 Months Spring 2022 Week 8 Live Session
- R in 3 Months Spring 2022 Week 8 Project Assignment
-
Week 9: Catch-Up Week
- R in 3 Months Spring 2022 Week 9 Office Hours
- R in 3 Months Spring 2022 Week 9 - Assignment Amnesty
-
Week 10: Going Deeper with R (Advanced Data Visualization, Part 1)
- Data Visualization Best Practices
- Tidy Data
- Pipe Data Into ggplot
- Reorder Plots to Highlight Findings
- Line Charts
- Use Color to Highlight Findings
- Declutter
- Use the scales Package for Nicely Formatted Values
- Use Direct Labeling
- R in 3 Months Spring 2022 Week 10 Office Hours
- R in 3 Months Spring 2022 Week 10 Live Session
- R in 3 Months Spring 2022 Week 10 Project Assignment
-
Week 11: Going Deeper with R (Advanced Data Visualization, Part 2)
- Use Axis Text Wisely
- Use Titles to Highlight Findings
- Use Color in Titles to Highlight Findings
- Use Annotations to Explain
- Tweak Spacing
- Customize Your Theme
- Customize Your Fonts
- Try New Plot Types
- R in 3 Months Spring 2022 Week 11 Live Session
- R in 3 Months Spring 2022 Week 11 Office Hours
- R in 3 Months Spring 2022 Week 11 Project Assignment
-
Week 12: Going Deeper with R (Advanced RMarkdown)
- Advanced Markdown Text Formatting
- Tables
- Advanced YAML
- Inline R Code
- Making Your Reports Shine: Word Edition
- Making Your Reports Shine: HTML Edition
- Making Your Reports Shine: PDF Edition
- Presentations
- Dashboards
- Other Formats
- You Did It!
- R in 3 Months Spring 2022 Week 12 Office Hours
- R in 3 Months Spring 2022 Week 12 Live Session
- R in 3 Months Spring 2022 Week 12 Project Assignment
-
Week 13: Final Assignment
- R in 3 Months Spring 2022 Week 13 Office Hours
- R in 3 Months Spring 2022 Week 13 Live Session
- R in 3 Months Spring 2022 Final Project Assignment
-
WEEK 14: Retrospective
R in 3 Months (Spring 2022)
Code Chunks
This lesson is locked
This lesson is called Code Chunks, part of the R in 3 Months (Spring 2022) course. This lesson is called Code Chunks, part of the R in 3 Months (Spring 2022) course.
If the video is not playing correctly, you can watch it in a new window
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
Change the default chunk options in the setup code chunk so that
echo = FALSE
. Knit your report and notice what is different.Change the chunk options in the cars code chunk so that
include = FALSE
. Knit your report and notice what is different.Add a new code chunk (don’t worry about naming it). In it, load the package
skimr
(hint: use thelibrary
function). Then, use theskim
function that you learned about in the Getting Started course (see the Examine our Data lesson in particular) to skim thecars
data frame. Knit your report to see the output.
Learn More
Many people print out the RMarkdown cheatsheet and keep it as a reference. It’s got a lot of information on YAML, Markdown text, and code chunks.
Interested in why you might considering naming code chunks? Maëlle Salmon wrote an article on this topic. Note that for most beginners, naming code chunks isn’t necessary. It’s only when you’re doing more complicated things with RMarkdown that it makes a difference.
You need to be signed-in to comment on this post. Login.
Lucilla Piccari
March 21, 2021
When knitting the added code chunk (the one where we used the skim() function) I got a different-looking result as the one demonstrated on the solution video, more "polished" looking, and I'm not sure why.
Atlang Mompe
March 21, 2021
Hi David,
The links for both these sections don't work: On another note, if you have issues getting the histograms to display properly and you’re using Windows, there is a known issue. Please see the skimr documentation for potential solutions.
Thanks, Atty
Jody Oconnor
March 24, 2021
My html output (after checking that my code is exactly the same as the example solution), also looks more 'polished'... there are no hash tags and the font is the report font, not the code font, and a few other differences. The warnings are not shown in the report, even before adding 'warning = FALSE, message = FALSE' Not sure what I would need to do to make the warnings/messages appear in the report.
Odile DOREUS
August 8, 2021
Hello, I did the steps but having error messages. So I went ahead and install tydiverse still not work.
Error: ERROR: no permission to install to directory ‘/usr/local/lib/R/site-library’ Warning in install.packages : installation of package ‘tidyverse’ had non-zero exit status The downloaded source packages are in ‘/tmp/RtmpGXw6hh/downloaded_packages’ > install.packages("skimr") Installing package into ‘/usr/local/lib/R/site-library’ (as ‘lib’ is unspecified) Warning in install.packages : 'lib = "/usr/local/lib/R/site-library"' is not writable Would you like to use a personal library instead? (yes/No/cancel)
Lina Khan
September 19, 2021
Hi David, similar to notes below, the report looks more polished, no ## and stuff.
https://imgur.com/369hjiU
Payal Mulchandani
September 20, 2021
Getting this error when I try to due Include=False: > ```{r cars, include=FALSE} Error: attempt to use zero-length variable name
Lindsay Quarles
October 18, 2021
Everything worked for me except the include = FALSE. The output never went away. I did not get any error message, the output just remained.
Sara Cifuentes
March 24, 2022
Is there a video in this section?
Sara Cifuentes
March 24, 2022
Yesterday something happened with videos, but now it is working!
Zaynaib Giwa
March 29, 2022
Hello everyone! I know that we don't go super in-depth with R-Markdown in this class but I was wondering what would be a scenario for giving a code chunk a name? Is it for reusability purposes if you need the same graph multiple times in a report?
Josh Gutwill
September 26, 2022
Where do the data for cars and for pressure come from? I don't see them in the getting-started-master folder, nor in the faketucky dataset. summary(cars) is clearly calling that data, but I don't see how. :-) Thanks!
Matt Kropp
September 28, 2022
Is there a way to knit code automatically every time it is run?
Ellen Wilson
October 5, 2022
Similar to what others have commented, I get a more polished looking result from the cars skim. No warnings or messages, no hashtags, and it has a data summary at the top (telling the number of columns and rows). I'm using a Mac. It doesn't seem like there was ever a definitive answer to what others said about this, and maybe it doesn't matter, but it is a bit puzzling.
Caitlin Tracey-Miller
October 12, 2022
I kept getting errors until I put my library request on the same line as the R code line. Is that strange?
Julieth Silao
October 31, 2022
Hello David. when i install new chuck and run skimr, i didnt get the summary report as in solution you provide
Dimeji Olawuyi
December 23, 2022
The warning message about the version disappeared when I uninstalled the version I was using and installed a recent version.