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. ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.