drop_na_rows drops rows that are NA in all specified variables.

drop_na_rows(population, variables)

Arguments

population

tbl with grouping (metadata) and observation variables.

variables

character vector specifying observation variables.

Value

population without rows that have NA in all specified variables.

Examples

population <- tibble::tibble( Metadata_group = c( "control", "control", "control", "control", "experiment", "experiment", "experiment", "experiment" ), Metadata_batch = c("a", "a", "b", "b", "a", "a", "b", "b"), AreaShape_Area = c(10, 12, NA, 16, 8, 8, 7, 7), AreaShape_Length = c(2, 3, NA, NA, 4, 5, 1, 5) ) variables <- c("AreaShape_Area", "AreaShape_Length") drop_na_rows(population, variables)
#> # A tibble: 7 x 4 #> Metadata_group Metadata_batch AreaShape_Area AreaShape_Length #> <chr> <chr> <dbl> <dbl> #> 1 control a 10 2 #> 2 control a 12 3 #> 3 control b 16 NA #> 4 experiment a 8 4 #> 5 experiment a 8 5 #> 6 experiment b 7 1 #> 7 experiment b 7 5