It's nice to see dqrng being used. However, I think a slightly different pattern would be appropriate since it is only in Suggests. Right now you have
requireNamespace('dqrng')
[...]
#Mixi <- matrix(rnorm(n=x, mean=Means[d], sd=SDs[d]), nrow=AnzPoints[d], ncol=1)
#MT 2019/03: das ist die schnelle version fuer den bottleneck
Mixi <- matrix(dqrng::dqrnorm(n=x, mean=Means[d], sd=SDs[d]), nrow=AnzPoints[d], ncol=1)
which will fail if dqrng is not installed. Instead you could either go from Suggests to Imports or use the fall-back pattern from Hadley's book
if (requireNamespace("dqrng", quietly = TRUE)) {
Mixi <- matrix(dqrng::dqrnorm(n=x, mean=Means[d], sd=SDs[d]), nrow=AnzPoints[d], ncol=1)
} else {
Mixi <- matrix(rnorm(n=x, mean=Means[d], sd=SDs[d]), nrow=AnzPoints[d], ncol=1)
}
BTW, you might be interested that dqrng also has support for fast sampling. Support for more distribution functions (like lnorm) is planned.
It's nice to see
dqrngbeing used. However, I think a slightly different pattern would be appropriate since it is only inSuggests. Right now you havewhich will fail if
dqrngis not installed. Instead you could either go fromSuggeststoImportsor use the fall-back pattern from Hadley's bookBTW, you might be interested that
dqrngalso has support for fast sampling. Support for more distribution functions (likelnorm) is planned.