Data are generated from an a density defined by a vector of integers.
addDataDensity(dtOld, dataDist, varname, uselimits = FALSE, na.rm = TRUE)
Name of data table that is to be updated.
Numeric vector. Defines the desired density.
Character. Name of the variable.
Logical. If TRUE, the minimum and maximum of the input data vector are used as limits for sampling. Defaults to FALSE, in which case a smoothed density that extends beyond these limits is used.
Logical. If TRUE (default), missing values in `dataDist` are removed. If FALSE, the data will retain the same proportion of missing values.
A data table with the generated data.