Description Usage Arguments Value Author(s) See Also Examples
For numeric variables, introduces a new indicator (binary) variable
for missing values and assigns a fixed, non-missing value for them
in the (renamed) original variable
For factors, introduces a new level for missing values and assigns
it to all missing values.
1 2 3 4 |
data |
a data.frame of quantitative variables. A vector will be converted to a one column data.frame |
vars |
variables (column names or indexes) to be treated.
It is usually not needed to specify |
na.prop |
limit for the proportion of NAs. Only those variables are treated that contain a higher proportion of missings. |
na.label |
for factors, label to be used for the new level of the factor |
na.values |
for numeric variables, value used in the .X variable for the NAs |
name.suffix |
suffix to be used for the new quantitative variables and the new indicator variables |
append |
logical: should the modified any newly created variables
be returned with the unmodified variables?
If |
... |
other arguments, to be passed to the function |
data.frame, containing,
for each numeric variable Vx
, a variable
Vx.X
and a variable Vx.NA
(if the default
name.suffix
is used),
for each factor, the factor consisting of the original values, but with NAs replaced by a level '.NA.' (unless specified otherwise).
If append
is true, the data.frame will be the same as the
input data
, except that factors containing NAs will have been
modified and the variables created for numeric variables containing
NAs will be appended. Note that no variables will be appended
for those that did not contain any NAs.
Werner A. Stahel
1 2 3 4 5 6 7 8 9 10 11 12 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.