Learn R Programming

epifit (version 0.1.2)

countNA: Count NAs in variables.

Description

Count NAs, and calculate NA proportion in data.frame.

Usage

countNA(data = NULL)

Arguments

data
a data.frame to summarize.

Value

a matrix with total data, NA count and NA proportion.

See Also

convertNA

Examples

Run this code
df <- data.frame(id=1:1000, cov1=rnorm(1000), cov2=runif(1000))
df$cov1 <- ifelse(df$cov1 < 0, NA, df$cov1)
df$cov2 <- ifelse(df$cov2 < 0.2, NA, df$cov2)
countNA(df)

Run the code above in your browser using DataLab