remove_na_rows: Remove NA rows

Description Usage Arguments Value Examples

View source: R/utils_tables.R

Description

Removes NA rows. If columns is not 'NULL', then will only remove rows in which all columns given have 'NA'. If columns is 'NULL', then will remove rows that are 'NA' across all columns.

Usage

1
remove_na_rows(data, columns = NULL)

Arguments

data

Data frame with metadata

columns

The columns to compare for 'NA' values.

Value

The data without rows that are 'NA' across the given columns.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
## Not run: 
dat <- data.frame(
  foo = c("bar0", NA, NA, "bar3"),
  bar = c(NA, "foo1", NA, "foo3")
)
dat1 <- remove_na_rows(dat)
dat2 <- remove_na_rows(dat, "foo")
dat3 <- remove_na_rows(dat, c("foo", "bar"))

## End(Not run)

Sage-Bionetworks/NicolesCurationTools documentation built on May 5, 2020, 8:29 a.m.