metan (version 1.2.1)

remove_na_values: Remove NA values

Description

These functions allow you to remove rows or columns with NA values quickly.

  • has_na(): Check for NA values in the data and return a logical value.

  • remove_rows_na(): Remove rows with NA values.

  • remove_cols_na(): Remove columns with NA values.

Usage

remove_rows_na(.data, verbose = TRUE)

remove_cols_na(.data, verbose = TRUE)

has_na(.data)

Arguments

.data

A data frame or tibble

verbose

Logical argument. If TRUE (default) shows in console the rows or columns deleted.

Value

A data frame with rows or columns with NA values deleted.

Examples

Run this code
# NOT RUN {
library(metan)
data_with_na <- data_g
data_with_na[c(1, 5, 10), c(3:5, 10:15)] <- NA
data_with_na
has_na(data_with_na)
remove_cols_na(data_with_na)
remove_rows_na(data_with_na)
# }

Run the code above in your browser using DataCamp Workspace