View source: R/utility_functions.R
na2zero | R Documentation |
Given a data.table DT
, replaces any NA
values
in the variables given in vars
in DT
. Takes a copy of the
original data and returns the modified copy.
na2zero(DT, vars = NULL)
DT |
|
vars |
a character string vector of variables names in |
Given a data.table
object, converts NA
values
to numeric (double) zeros for all variables named in vars
or
all variables if vars = NULL
.
A copy of DT
where NA
values have been replaced with zero.
Joonas Miettinen
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.