Removes rows with more than thresh NA's from matrix

remove_NA_rows(obj, thresh = 0)

Arguments

obj

matrix or dataframe

thresh

- maximum number of NA's / row - if more the row will be removed

Value

matrix

Examples


obj = matrix(rnorm(10*10),ncol=10)
dim(obj)
#> [1] 10 10
obj[3,3] = NA
x1 = remove_NA_rows(obj, thresh=0)
stopifnot(all(c(9,10)==dim(x1)))
x2 = remove_NA_rows(obj, thresh=1)
stopifnot(all(c(10,10)==dim(x2)))