This is a very simple infix function for the common TractoR idiom whereby
NULL
is used as a default argument value, but later needs to be
resolved to a meaningful value if not overridden in the call. It returns its
first argument unless it is NULL
, in which case it falls back on the
second argument.
X %||% Y
X
, if it is not NULL
; otherwise Y
.
R objects, possibly NULL
.
Jon Clayden
Please cite the following reference when using TractoR in your work:
J.D. Clayden, S. Muñoz Maniega, A.J. Storkey, M.D. King, M.E. Bastin & C.A. Clark (2011). TractoR: Magnetic resonance imaging and tractography with R. Journal of Statistical Software 44(8):1-18. tools:::Rd_expr_doi("10.18637/jss.v044.i08").
where
, which resolves a value if an expression is
TRUE
. Several calls to that function can be conveniently chained
together with this one.