On Sunday, November 18, 2012, Rlotus wrote: > Gives a mistake that "probability" is not found > > x<- runif(1,0,1) > y<-x^5+x^8+(cos(x))^3 > yrandom<- runif(10,0,3) > if (y<yrandom) {probabibility=y/yrandom} > area=probability*3 > > You're ignoring the warning that's also given. Read ?ifelse and be enlightened
Cheers Michael > > > > -- > View this message in context: > http://r.789695.n4.nabble.com/How-to-fix-it-tp4649955.html > Sent from the R help mailing list archive at Nabble.com. > > ______________________________________________ > R-help@r-project.org <javascript:;> 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. > [[alternative HTML version deleted]] ______________________________________________ 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.