inspect_na {cleandata} | R Documentation |
Find Out Which Columns Have Most NAs
Description
Return the names and numbers of NAs of columns that have top # (refer to argument top
) most NAs.
Usage
inspect_na(x, top=ncol(x))
Arguments
x |
The data frame |
top |
The value of #. |
Value
A named vector.
Examples
# building a data frame
A <- as.factor(c('y', 'x', 'x', 'y', 'z'))
B <- c(6, 3:6)
C <- 1:5
df <- data.frame(A, B, C)
df[3, 1] <- NA; df[2, 2] <- NA; df[4, 2] <- NA; df [5, 3] <- NA
print(df)
# inspection
a <- inspect_na(df)
print(a)
[Package cleandata version 0.3.0 Index]