[R] How to comment a paragraph?

Jonathan Baron baron at cattell.psych.upenn.edu
Mon May 13 12:11:48 CEST 2002


On 05/13/02 17:33, ken_lee wrote:
>Dear all,
>     I just knew the prompt "#" can comment a line,but tow to comment a paragraph more than one line?

If the line you just typed is what you consider a paragraph, it
is really one long line, so you have no problem (although other
people might have a problem reading it).

If a "paragraph" is like what I just typed, then, indeed, it has
line breaks in the middle.  One way to make paragraphs, or blocks
of code, into comments is to use ESS with Emacs or Xemacs.  (See
Software/Other on http://cran.r-project.org.)  You mark the block
(with ctrl-space, for example), then use the command M-x
comment-region.  M-x works as alt-x for me.

This is how I save blocks of code that I want to remember but
don't want to run every time I load a data set.
-- 
Jonathan Baron, Professor of Psychology, University of Pennsylvania
Home page: http://www.sas.upenn.edu/~baron
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
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
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list