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.
Este ejercicio forma parte del curso
Helsinki Open Data Science
Instrucciones del ejercicio
- Access the dplyr library
- As an example, create object
male_studentsby selecting the male students fromlearning2014 - Override
learning2014and 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'.
Ejercicio interactivo práctico
Prueba este ejercicio y completa el código de muestra.
# learning2014 is available
# access the dplyr library
library(dplyr)
# select male students
male_students <- filter(learning2014, gender == "M")
# select rows where points is greater than zero
learning2014 <-