1. Learn
  2. /
  3. Courses
  4. /
  5. Helsinki Open Data Science

Connected

Exercise

Excluding observations

Often your data includes outliers or other observations which you wish to remove before further analysis. Or perhaps you simply wish to work with some subset of your data.

In the learning2014 data the variable 'points' denotes the students exam points in a statistics course exam. If the student did not attend an exam, the value of 'points' will be zero. We will remove these observations from the data.

Instructions

100 XP
  • Access the dplyr library
  • As an example, create object male_students by selecting the male students from learning2014
  • Override learning2014 and select rows where the 'points' variable is greater than zero.
  • If you do not remember how logical comparison works in R, see the 'Logical comparison' exercise from the course 'R short and sweet'.