learner1978 <sakp4mcl <at> gmail.com> writes: > > > 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.
Two answers: (1) [short term] fix(f) (2) [long term] develop your code in a text editor (Tinn-R, emacs, R source code editor accessible from the menu ...) and cut & paste or source() as necessary. ______________________________________________ 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.