na2zero {popEpi} | R Documentation |
Convert NA's to zero in data.table
Description
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.
Usage
na2zero(DT, vars = NULL)
Arguments
DT |
|
vars |
a character string vector of variables names in |
Details
Given a data.table
object, converts NA
values
to numeric (double) zeros for all variables named in vars
or
all variables if vars = NULL
.
Value
A copy of 'DT' where 'NA' values have been replaced with zero.
Author(s)
Joonas Miettinen
[Package popEpi version 0.4.12 Index]