Hi R-users,
I have the following code:
f -function(x,p)sqrt(-(x^2)-2*log(1-p))
r1 -sqrt(-2*log(1-0.95))
r2 -sqrt(-2*log(0.05))
on executing i get the following results
f(r1,0.95)
[1] 0
f(r2,0.95)
[1] NaN
Warning message:
NaNs produced in: sqrt(-(x^2) - 2 * log(1 - p))
I tried to track
Your loop will store results of count =6 because
every time the loop executes the results are put in
qw so you replace the previous results. On the other
hand the results of count=1 is not extracted you basicaly
start at 2.
My advice is you initialize qw before the loop and stack the results
one
In your current definitions a can not change value to
new unless you type a-test(). If you want the
results of the test to be global then you add something like this
test -function()a-new
This will always replace the existing value of a once
you type test()
regards
Anthony- Original