defaults_to.Rd
Set a default value for an argument
defaults_to(value) alist %=% value
Default value
Left-hand side, argument definitions such as classes or conditions
f1 <- def(x = defaults_to(0), { x + 1 }) f2 <- def(x = "numeric" %=% 0, { x + 1 }) f1() # => 1#> [1] 1f2() # => 1#> [1] 1