-
Notifications
You must be signed in to change notification settings - Fork 8
Closed
Labels
featurefeature request or enhancementfeature request or enhancement
Description
The below example demonstrates a small issue i ran into when i was trying to generate data from an arbitrary distribution using the genDataDensity
function:
R> library("NHANES")
R> library("simstudy")
R> x <- NHANES$Height
R> d <- genDataDensity(n=500L,x,varname="ht")
Error in density.default(dataDist, n = 10000) :
'x' contains missing values
R> d <- genDataDensity(n=500L,x[!is.na(x)],varname="ht") ## workaround
R> ## d <- genDataDensity(n=500L,x,varname="ht",na.rm=TRUE) ## would be nice...
Since na.rm=FALSE
is also the default for stats::density
, I understand why you do not include na.rm
argument for these functions. Can I please make a request to add na.rm
argument to the genDataDensity
and addDataDensity
functions? I will benefit from having this pass-through argument as a part of these function calls. And, since i know a workaround I can definitely generate the data without this argument. Therefore, whatever you decide is fine with me.
Thanks for a great package! I love using simstudy!
Metadata
Metadata
Assignees
Labels
featurefeature request or enhancementfeature request or enhancement