check.na: Verify variables with NA

Description Usage Arguments Value Author(s) References Examples

View source: R/check.na.R

Description

This function receives a data set and calculates the number of NAs to each variable, then calculates the percentual of existing NAs and inform the variables, number/percent of NAs.

Usage

1
check.na(data.to.work)

Arguments

data.to.work

is a data set containing the variables to check NAs.

Value

the number and percent of NAs.

Author(s)

Elias Carvalho

References

LITTLE, R J A; RUBIN, D B. Statistical analysis with missing data. John Wiley & Sons, 2014.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
# Clean environment
closeAllConnections()
rm(list=ls())
# Set enviroment
# setwd("to your working directory")
# Load packages
library(bnpa)
# Use working data sets from package
data(dataQuantC)
head(dataQuantC)
# Adding NAs to dataQuantC # credits for the random NA code for: https://goo.gl/Xj6caY
dataQuantC <- as.data.frame(lapply(dataQuantC, function(cc) cc[ sample(c(TRUE, NA),
                             prob = c(0.85, 0.15), size = length(cc), replace = TRUE) ]))
# Checking the Nas
check.na(dataQuantC)

bnpa documentation built on Aug. 2, 2019, 1:05 a.m.

Related to check.na in bnpa...