powered by
Convenience function for coalescing to zero
coalesce0(x, nThread = getOption("hutilscpp.nThread", 1L))COALESCE0(x, nThread = getOption("hutilscpp.nThread", 1L))
COALESCE0(x, nThread = getOption("hutilscpp.nThread", 1L))
Equivalent to hutils::coalesce(x, 0) for an appropriate type of zero. COALESCE0(x)
hutils::coalesce(x, 0)
COALESCE0(x)
For complex numbers, each component is coalesced. For unsupported types, the vector is returned, silently.
An atomic vector. Or a list for COALESCE0.
COALESCE0
Number of threads to use.
coalesce0(c(NA, 2:3)) coalesce0(NaN + 1i)
Run the code above in your browser using DataLab