From the course: Learning the R Tidyverse
Unlock the full course today
Join today to access over 22,600 courses taught by industry experts or purchase this course individually.
Filter out NA values - R Tutorial
From the course: Learning the R Tidyverse
Filter out NA values
- [Instructor] Dplyr is a member of the tidyverse ecosystem designed for manipulating data with a variety of different verbs. Filter is the verb that allows us to filter data according to conditions. For instance, please return me countries with an area greater than X. But how about if you want to return those observations where there is missing or not applicable data, well, NA has special significance in R, as missing data. It is detected using the function, is.na. Filter allows us to easily remove any row from a data frame which contains NA values and we can also return only those values which are complete using complete cases. Let's see some quick examples of that in our studio. So, in our exercise files, we have a data folder which is currently empty and in our data-raw folder, we have a csv file and a folder called, data-tidying.R. Let's open that up and see what we have here. At the top, we have library tidyverse, which loads us the tidyverse library which I run with command…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
-
-
(Locked)
Separate raw and clean data folders2m 48s
-
(Locked)
Import .xlsx files with readxl in R12m 19s
-
(Locked)
Import .csv files with readr into R5m 38s
-
(Locked)
Is it a data frame or a tibble?10m 43s
-
(Locked)
Select and filter data9m 32s
-
(Locked)
Convert strings to dates with mutate6m 40s
-
(Locked)
Separating columns into multiple columns6m 36s
-
(Locked)
Filter out NA values3m 35s
-
(Locked)
Export .csv files with readr5m 6s
-
(Locked)
Export .rdata objects for later4m 51s
-
(Locked)
-
-
-
-