coalesce: select 1st existing value of several columns
Description
Inspired by the respectively named sql function.
In a list of vectors with equal length the function for each
of the observations selects the first value that is not NA,
in the order provided
Usage
coalesce(...)
Arguments
...
vectors holding the values, sepearated by ","
(commonly columns of data.frame)
Value
A named vector holding the supplemented values
Details
Data are transformed according to $$b=\frac{2^M}{2^M+1}$$