Displaying 1 result from an estimated 1 matches for "953668".
Did you mean:
753668
2017 Sep 02
6
Strange lazy evaluation of default arguments
Dear R developers,
sessionInfo() below
Please have a look at the following two versions of the same function:
1. Intended behavior:
> Su1 = function(u=100, l=u, mu=0.53, sigma2=4.3^2)
+ {
+ print(c(u, l, mu)) # here, l is set to u?s value
+ u = u/sqrt(sigma2)
+ l = l/sqrt(sigma2)
+ mu = mu/sqrt(sigma2)
+ print(c(u, l, mu))
+ }
>
> Su1()
[1] 100.00 100.00 0.53
[1]