I want to make a function for geometric seqeunce

since

testing=function(x){i=1;ans=1;while(true){ans=ans+(1/x)^i ; i=i+1}
;return(ans)}

doesn't work... the program is freeze... from my research, i know i should
use iterators.

I read iterators.pdf at
http://cran.r-project.org/web/packages/iterators/iterators.pdf and didnt
find it helps solving my problem at all...

Is there any sources I can look up to?

Thanks
Ting
-- 
View this message in context: 
http://r.789695.n4.nabble.com/Performing-a-geometric-seqeunce-using-iterators-tp3035465p3035465.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.

Reply via email to