I think you are missing a parenthesis around your condition [1][2]. For future reference: a) You should post the code you ran as well as the error message... it is unusual for the error message alone to be enough to figure out the problem. In fact, try to make a "reproducible example" [3][4][5]... you will increase your chances of getting an answer. b) Your message was garbled... in some cases this can completely obscure your question. You can prevent that from happening by setting your email program to create a plain text email whenever you post here. c) Remember to put a subject line on your email.
[1] https://stat.ethz.ch/R-manual/R-devel/library/base/html/Control.html [2] https://www-r--bloggers-com.cdn.ampproject.org/v/s/www.r-bloggers.com/control-structures-loops-in-r/ [3] http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example [4] http://adv-r.had.co.nz/Reproducibility.html [5] https://cran.r-project.org/web/packages/reprex/index.html (read the vignette) On July 15, 2018 6:25:43 AM PDT, Atanasio Alberto Tembe Tembe <manote...@gmail.com> wrote: >Hello! > >Is there anyone who can help me to this the error bellow? Ijust >started using R recently. Thank you > > >while sum(abs(Sb-D-Sc-t(Pi))>1E-5{Error: unexpected symbol in "while >sum"> > k=K+1> > for(i in 1:nrow(c1)){+ + > for(j in 1:ncol(c1)){+ + if(Sb!=0){+ > + T2=D*T/Sa+ + >}else {+ + T2=0 + > + }+ + Sc=sum(t(T))+ >+ if(Sc!=0){+ + >T3=Pi*T2/Sc+ + }else {+ + > T3=0+ + }+ >Sb=sum(T)+ + }+ }> > K[1] 0 > > [[alternative HTML version deleted]] > >______________________________________________ >R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see >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. -- Sent from my phone. Please excuse my brevity. ______________________________________________ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see 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.