coalesce0: Convenience function for coalescing to zero

View source: R/coalesce0.R

coalesce0R Documentation

Convenience function for coalescing to zero

Description

Convenience function for coalescing to zero

Usage

coalesce0(x, nThread = getOption("hutilscpp.nThread", 1L))

COALESCE0(x, nThread = getOption("hutilscpp.nThread", 1L))

Arguments

x

An atomic vector. Or a list for COALESCE0.

nThread

Number of threads to use.

Value

Equivalent to hutils::coalesce(x, 0) for an appropriate type of zero. COALESCE0(x)

For complex numbers, each component is coalesced. For unsupported types, the vector is returned, silently.

Examples

coalesce0(c(NA, 2:3))
coalesce0(NaN + 1i)


hutilscpp documentation built on Oct. 11, 2023, 9:06 a.m.