Drawing Trig Function
Just out of curiousity, why is it I can't do multiple commenting in R. I have to type # in front of each line (well, it's true). If there are 20 or more lines it becomes a bit annoying. In SAS there is /* blah blah blah */, which comments out an entire block. Java and C++ have the similar feature too. Will it be possible to put this feature in R in the future? Just some personal opinions, Ko-Kang
Peter Dalgaard BSA wrote:
Ben Bolker <ben at zoo.ufl.edu> writes:
if (FALSE) {}
around the stuff you want to comment out.
This won't work if you have open parentheses or other "syntax errors" in
the commented region.
..and if you use it to remove largish blocks in scripts fed to stdin, you'll notice that it takes quit a lot of time. This is due to a current silliness in the R parser: Whenever we see a newline, we check whether the expression is complete. If so, then we evaluate it, otherwise we *reparse* what has already been seen, adding another line. This makes parsing O(k^2) in the number of lines in an expression which is really unnecessary. It's just that noone has figured out how to do the required checkpointing of the bison/yacc parser yet. The effect doesn't happen when you source() files, because in that case we always parse the entire file before executing it. -- O__ ---- Peter Dalgaard Blegdamsvej 3 c/ /'_ --- Dept. of Biostatistics 2200 Cph. N (*) \(*) -- University of Copenhagen Denmark Ph: (+45) 35327918 ~~~~~~~~~~ - (p.dalgaard at biostat.ku.dk) FAX: (+45) 35327907
-- ----------------------------------------------------------------------------------- Ko-Kang Wang Undergraduate Student Computer Science/Statistics Double Major University of Auckland Auckland 1005 New Zealand ----------------------------------------------------------------------------------- -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._