NaVar {DataCombine} | R Documentation |
Create new variable(s) indicating if there are missing values in other variable(s)
Description
Create new variable(s) indicating if there are missing values in other variable(s)
Usage
NaVar(data, Var, Stub = "Miss_", reverse = FALSE, message = TRUE)
Arguments
data |
a data frame object. |
Var |
a character vector naming the variable(s) within which you would like to identify missing values. |
Stub |
a character string indicating the stub you would like to append to the new variables' name(s). |
reverse |
logical. If |
message |
logical. Whether or not to give you a message about the names of the new variables that are created. |
Examples
# Create data frame
a <- c(1, 2, 3, 4, NA)
b <- c( 1, NA, 3, 4, 5)
ABData <- data.frame(a, b)
# Create varibles indicating missing values in columns a and b
ABData1 <- NaVar(ABData, Var = c('a', 'b'))
# Create varible indicating missing values in columns a with reversed dummy
ABData2 <- NaVar(ABData, Var = 'a', reverse = TRUE, message = FALSE)
[Package DataCombine version 0.2.21 Index]