[R] assign if not set

Alexy Khrabrov deliverable at gmail.com
Tue Nov 20 01:32:12 CET 2007


What's the idiom of assigning a default value to a variable if it's  
not set?  In Ruby one can say

v ||= default

-- that's an or-assign, which triggers the assignment only if v is  
not set already.  Is there an R shorthand?

Cheers,
Alexy



More information about the R-help mailing list