Dear expeRts, ?? I find it's terrible? when? i want to comment multi paragraph (e.g.? a 30 lines function) , i have to comment each line with #,? is there any good way to do that ? ?? I investgate it, but found no easy way, may you help me ? -- PO SU mail: desolator88 at 163.com Majored in Statistics from SJTU
Jeff Newmiller
2014-Sep-09 03:14 UTC
[R] How to use multi paragraph comment like /* and */ in cpp?
There are no multi line comment markers in R. However, since you are always
referring to RStudio you might want to look into roxygen, since their editor
supports that tool.
I would also suggest making more functions that are smaller.
---------------------------------------------------------------------------
Jeff Newmiller The ..... ..... Go Live...
DCN:<jdnewmil at dcn.davis.ca.us> Basics: ##.#. ##.#. Live
Go...
Live: OO#.. Dead: OO#.. Playing
Research Engineer (Solar/Batteries O.O#. #.O#. with
/Software/Embedded Controllers) .OO#. .OO#. rocks...1k
---------------------------------------------------------------------------
Sent from my phone. Please excuse my brevity.
On September 8, 2014 7:49:32 PM PDT, PO SU <rhelpmaillist at 163.com>
wrote:>
>Dear expeRts,
>?? I find it's terrible? when? i want to comment multi paragraph (e.g.?
>a 30 lines function) , i have to comment each line with #,? is there
>any good way to do that ?
>?? I investgate it, but found no easy way, may you help me ?
>
>
>
>
>
>--
>
>PO SU
>mail: desolator88 at 163.com
>Majored in Statistics from SJTU
>______________________________________________
>R-help at 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.
Pascal Oettli
2014-Sep-09 03:51 UTC
[R] How to use multi paragraph comment like /* and */ in cpp?
A workaround is to escape the evaluation of the lines. For example:
tt <- 0
while(tt > 0){
cat('rr\n')
}
Regards,
Pascal
On Tue, Sep 9, 2014 at 11:49 AM, PO SU <rhelpmaillist at 163.com>
wrote:>
> Dear expeRts,
> I find it's terrible when i want to comment multi paragraph (e.g.
a 30 lines function) , i have to comment each line with #, is there any good
way to do that ?
> I investgate it, but found no easy way, may you help me ?
>
>
>
>
>
> --
>
> PO SU
> mail: desolator88 at 163.com
> Majored in Statistics from SJTU
> ______________________________________________
> R-help at 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.
--
Pascal Oettli
Project Scientist
JAMSTEC
Yokohama, Japan
Martin Maechler
2014-Sep-09 13:36 UTC
[R] How to use multi paragraph comment like /* and */ in cpp?
>>>>> "PS" == PO SU <rhelpmaillist at 163.com> >>>>> on Tue, 9 Sep 2014 10:49:32 +0800 writes:PS> Dear expeRts, ?? I find it's terrible? when? i want to PS> comment multi paragraph (e.g.? a 30 lines function) , i PS> have to comment each line with #,? is there any good way PS> to do that ? ?? I investgate it, but found no easy way, PS> may you help me ? Even though I can easily mark such a block and use the general emacs comment key M-; to comment each of those lines, I often prefer if(FALSE) { ... ... ... } which in the case of a single function definition which is only one R expression can even do without the braces {, } and hence very easily activated/deactivated.
Bos, Roger
2014-Sep-09 16:37 UTC
[R] How to use multi paragraph comment like /* and */ in cpp?
What I do in cases like that is wrap the code in a FALSE statement so it
won't get executed: its easy to add and remove as needed.
If (FALSE) {
...Code to exclude....
}
***************************************************************
This message and any attachments are for the named person's use only.
This message may contain confidential, proprietary or legally privileged
information. No right to confidential or privileged treatment
of this message is waived or lost by an error in transmission.
If you have received this message in error, please immediately
notify the sender by e-mail, delete the message, any attachments and all
copies from your system and destroy any hard copies. You must
not, directly or indirectly, use, disclose, distribute,
print or copy any part of this message or any attachments if you are not
the intended recipient.
-----Original Message-----
From: r-help-bounces at r-project.org [mailto:r-help-bounces at r-project.org]
On Behalf Of PO SU
Sent: Monday, September 08, 2014 10:50 PM
To: R. Help
Subject: [R] How to use multi paragraph comment like /* and */ in cpp?
Dear expeRts,
I find it's terrible when i want to comment multi paragraph (e.g. a 30
lines function) , i have to comment each line with #, is there any good way to
do that ?
I investgate it, but found no easy way, may you help me ?
--
PO SU
mail: desolator88 at 163.com
Majored in Statistics from SJTU
______________________________________________
R-help at 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.