Displaying 1 result from an estimated 1 matches for "out_sqrt".
Did you mean:
int_sqrt
1998 Sep 14
1
R-beta: Applying functions to vectors--question
...re that is there for a good reason that I just
haven't figured out
(b) a bug in S that has been reproduced in R
or
(c) a bug unique to R.
Can someone help me out? Many thanks in advance
Marc Lipsitch
lipsitch at biology.emory.edu
> f_function(e) {
+
+ out_0
+
+ if(e>0)
+
+ out_sqrt(e)
+
+ out}
>
>
>
> f(-2)
[1] 0
>
> f(-2:2)
[1] 0
>
> f(2:-2)
Warning: NaNs produced in function "sqrt"
[1] 1.414214 1.000000 0.000000 NaN NaN
> f
function (e)
{
out <- 0
if (e > 0)
out <- sqrt(e)
out
}
_____...