clean_income | R Documentation |
This utility us used to tidy up or provide warnings in the functions that use weights
clean_income(
x,
w = rep(1, length(x)),
no.negatives = FALSE,
no.nans = TRUE,
no.infinites = TRUE,
na.rm = TRUE
)
x |
an income vector or matrix |
w |
the vector of weights |
no.negatives |
a logical indicating whether negative values in the data should be removed. The default value is false |
no.nans |
a logical indicating whether NaN:s in the data should be removed. The default value is TRUE |
no.infinites |
a logical indicating whether infinite values in the data should be removedd. The default value is TRUE |
na.rm |
A logical indicating whether NA:s should be removed from the data. The default value is TRUE |
A matrix with as many columns equal to the number of columns in x plus one for the weights, and rows with the inappropriate oobservations removed.
Markus Jantti markus.jantti@iki.fi
complete.cases
, na.omit
x <- c(NA, 1:5, Inf, -1, NaN, -Inf)
w <- rpois(length(x), 2)
clean_income(x, w)
x <- cbind(x, y = rpois(length(x), 10))
clean_income(x, w)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.