Back to Course

R for Busy People (Cohort-0)

0% Complete
0/0 Steps
  1. Installing R and RStudio
    1 Lesson
    |
    2 Quizzes
  2. The RStudio IDE
    1 Lesson
    |
    2 Quizzes
  3. Coding Basics
    1 Lesson
    |
    2 Quizzes
  4. Assignment | Workshop 1
    1 Quiz
  5. Data dive: Ebola in Sierra Leone
    1 Lesson
    |
    2 Quizzes
  6. RStudio Projects
    1 Lesson
    |
    2 Quizzes
  7. Workshop 2
    1 Lesson
    |
    1 Quiz
  8. Using R Markdown
    1 Lesson
    |
    2 Quizzes
  9. Data classes & structures (deprec)
    2 Lessons
  10. Workshop 3
    1 Lesson
    |
    1 Quiz
  11. Select & rename
    1 Lesson
    |
    3 Quizzes
  12. Filter
    1 Lesson
    |
    3 Quizzes
  13. Workshop 4
    1 Quiz
  14. Mutate
    1 Lesson
    |
    3 Quizzes
  15. Workshop 5
    1 Lesson
    |
    1 Quiz
  16. Conditional mutate
    1 Lesson
    |
    3 Quizzes
  17. Group by and summarize
    1 Lesson
    |
    2 Quizzes
  18. Workshop 6
    1 Lesson
    |
    1 Quiz
  19. Other grouped operations
    1 Lesson
    |
    2 Quizzes
  20. Workshop 7
    1 Lesson
    |
    1 Quiz
  21. Intro to ggplot2
    1 Lesson
    |
    2 Quizzes
  22. Scatter plots and smoothing
    1 Lesson
    |
    2 Quizzes
  23. Workshop 8
    1 Lesson
    |
    1 Quiz
  24. Lines, scales, and labels
    1 Lesson
    |
    2 Quizzes
  25. Overview of the EpiGraphHub web platform
  26. Data exploration on EpiGraphHub
    1 Quiz
  27. Workshop 9
    1 Lesson
    |
    1 Quiz
  28. Workshop 10
    1 Lesson
    |
    1 Quiz
  29. Final project
    1 Lesson
    |
    1 Quiz
  30. Getting help
    1 Lesson
    |
    1 Quiz
  31. Quiz contributions
    16 Lessons
Topic 12, Lesson 1
In Progress

Lesson | Filter

Topic Progress
0% Complete

Lesson code

To work on the practice questions in the data wrangling module, you need to download the project folder for the lesson. Click on one of the buttons below to download this folder as a zip file.

Click the first option if you are working on RStudio on your local computer. Click the second option If you are using RStudio cloud.

If you are working on your local computer, you should then:

  • Unzip the folder
  • Double-click on the Rstudio Project file to open the project in RStudio
  • Open the Rmd lesson from the Files tab in RStudio, and follow along!

If you are working on RStudio cloud, you should then:

  • Start a new project on RStudio Cloud
  • Upload the zip file you just downloaded to the Files tab of RStudio.
  • Open the Rmd lesson, again in the Files tab in RStudio, then follow along!

Lesson notes

The written guide below is an accompaniment to the lesson video. You may read through it if you prefer written tutorials to video content.

Subscribe
Notify of
guest

11 Comments
Newest
Oldest Most Voted
Inline Feedbacks
View all comments
Emneteab (Emnet)

what would be the case for this question ? Lauras answer is 422 but mine is 10 ?

## how many respondents were male?
> yao %>% 
+   filter(sex=="male")%>%
+   ncol()
[1] 10

Thank you !

Kene David

It probably means you have modified your dataset in some way. Check closely to see if this is the case.

Emneteab (Emnet)

What is happening with this code? Q_is_pregnant<- yao %>% filter("is_pregnant") Error in filter(): ℹ In argument: "is_pregnant". Caused by error: ! ..1 must be a logical vector, not the string "is_pregnant". Run rlang::last_trace() to see where the error occurred. It is the example given by the system but when it run it appeared… Read more »

Kene David

Hello Emnet. I believe you need to remove the quotes around is_pregnant

Emneteab (Emnet)

Thanks, David !!!

Alice

Would be useful to post the answers to the questions in the lessons somewhere, maybe at the end of the video? Or at the end of the accompanying lesson script.

Kene David

Thanks for the suggestion! For later lessons, there will be a function that prints the answer to each question. But the first two lessons are missing this functionality. We’ll add this soon.

Kene David

Hi Alice. We have updated the lesson Rmd with solutions now. Please see this video: https://vimeo.com/767363677 for a walkthrough.

Eric Donald

q8 is ambiguous about which dataset to use

Kene David

Thank you for pointing out! We will check and correct this soon!

Kene David

This has now been fixed! Thanks again.

11
0
Questions or comments?x