[R] Editing a function

learner1978 sakp4mcl at gmail.com
Sat Feb 27 21:54:04 CET 2010


I am beginner to R.

I have written a function:

f= function(n=100,p=0.5){
X=rbinom(100,n,p)
(mean(X)-n*P)/sqrt(n*p*(1-p))
}

But I made a mistake by typing "P" instead of "p". How do I edit this
function and improve my mistake. If I use edit(f) it opens an edit window
where I am able to change the function but when I type "f" I see the same
old function. R does not seem to save my change even though it prompts me to
save before I close the edit window. I do not want to retype the whole
function all over again.

-- 
View this message in context: http://n4.nabble.com/Editing-a-function-tp1572251p1572251.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list