removeNAs: Removes rows with NAs in a data frame

Description Usage Arguments Value Examples

View source: R/miscUtils.R

Description

Removes rows with NAs in columns specified by .vars argument

Usage

1
removeNAs(df, vars)

Arguments

.df

a data frame

.vars

a charactor vector containing names of columns to search for NAs

Value

a data.frame purged of all rows with NAs in the columns specified by .vars

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
test_df <- diag(3)
diag(test_df) <- NA
test_df <- data.frame(test_df)
removeNAs(test_df, c("X1", "X3"))
> 1 (33.3%) missing value(s) found in X1
> 1 (33.3%) missing value(s) found in X3
> 2 observation(s) with missing values removed from dataset,
> 1 of 3 (33.3%) remaining
> X1 X2 X3
> 2  0 NA  0

kikapp/kikapputils documentation built on May 24, 2021, 10:41 p.m.