DetectEmptyRows: detect rows with NA vaues

Description Usage Arguments Value Examples

View source: R/DataCombine.R

Description

1
2
complete.cases does not work on tibbles!
This function is written in package DataCombine style.

Usage

1
DetectEmptyRows(x, Var = colnames(x), Ele = "All")

Arguments

x

data.frame

Var

columns determining complete cases. Can be column names or positions. Var is the determiner of empty rows. Other columns are ignored.

Ele

"All"(default), of elements in Var, the test results. The other option is "Any".

Value

df with rows of all-NA removed

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
## Not run: 
data.frame(A = c(1,NA,NA), B = c(11,12,NA), C = c(101,102,103))
   A  B   C
1  1 11 101
2 NA 12 102
3 NA NA 103

DetectEmptyRows(data.frame(A = c(1,NA,NA), B = c(11,12,NA), C = c(101,102,103)),
  Var = c("A","B"))
[1] FALSE FALSE  TRUE

## End(Not run)

AndreMikulec/econModel documentation built on June 30, 2021, 9:48 a.m.