Hi all, I'm a relatively new user to the R interface, and am trying to do some basic operations. So far I've used the curve() command to plot graphs. This has a couple of limitations, namely trying to do piecewise graphs. Basically, I'm looking for how to do "if" and "while" loops for making a graph.
in simple code, something like: if x is on the interval [-1,1], x=x^2+1 otherwise, x=x^2 something along those lines. I also am wondering if it's possible to graph something like this: while(n<20) { curve(1/n^2, -1,1) n++ } Along these same lines, is there a way to graph finite series? Thank you for your time and your replies. -- View this message in context: http://www.nabble.com/Question-on-graphs-and-simple-if-statements-tf4366956.html#a12446999 Sent from the R help mailing list archive at Nabble.com. ______________________________________________ R-help@stat.math.ethz.ch 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.