Re: [R] How to comment in R

2009-02-12 Thread Wacek Kusnierczyk
Berwin A Turlach wrote: > G'day Wacek, > g'orning Berwin, > > Are you talking about the patch in: > http://tolstoy.newcastle.edu.au/R/e6/devel/09/01/0201.html > i do. > ? > > That one does not look like a patch against the svn sources; see > http://wiki.r-project.org/rwiki/dok

Re: [R] How to comment in R

2009-02-12 Thread Berwin A Turlach
G'day Wacek, On Wed, 11 Feb 2009 22:02:21 +0100 Wacek Kusnierczyk wrote: > Gavin Simpson wrote: > > On Wed, 2009-02-11 at 20:22 +0100, Wacek Kusnierczyk wrote: > > > >> Greg Snow wrote: > >> > >>> If it is fairly trivial to implement then go ahead and implement > >>> it, patches are alwa

Re: [R] How to comment in R

2009-02-11 Thread Wacek Kusnierczyk
Greg Snow wrote: > Apparently I was not clear in my intention in my original reply. I have no > problem with you or anyone else implementing this in whatever way. Someone > could even use Friedl's regex to write a preprocessor in R, he did the hard > work already if you follow the rules that h

Re: [R] How to comment in R

2009-02-11 Thread Wacek Kusnierczyk
Duncan Murdoch wrote: > >> >> what about cases where the syntax is 'obvious' and yet r does the >> opposite of what one would expect? > > We shouldn't add features like that either. In some cases we have (or > S did), and the thousands of CRAN packages mean we're stuck with most > of them. ... wh

Re: [R] How to comment in R

2009-02-11 Thread Greg Snow
ent: Wednesday, February 11, 2009 12:45 PM > To: Greg Snow > Cc: R help > Subject: Re: [R] How to comment in R [snip] > > hey, be fair. i was talking about the perl-style pod block comments, > where it *is* very easy to implement. Your phrase that I responded to was: "an exte

Re: [R] How to comment in R

2009-02-11 Thread Wacek Kusnierczyk
Duncan Murdoch wrote: > >>> >>> So if the behaviour isn't very obvious in cases like the one quoted >>> above, and if the new syntax doesn't add any new expressiveness, I >>> would be opposed to adding it. >> >> what about cases where the syntax is 'obvious' and yet r does the >> opposite of what o

Re: [R] How to comment in R

2009-02-11 Thread Duncan Murdoch
On 2/11/2009 3:52 PM, Wacek Kusnierczyk wrote: Duncan Murdoch wrote: On 2/11/2009 2:27 PM, Wacek Kusnierczyk wrote: Duncan Murdoch wrote: On 2/11/2009 1:21 PM, Stavros Macrakis wrote: On Wed, Feb 11, 2009 at 12:32 PM, Greg Snow wrote: ...The c-style of /* */ allows both types and you can co

Re: [R] How to comment in R

2009-02-11 Thread Wacek Kusnierczyk
Gavin Simpson wrote: > On Wed, 2009-02-11 at 20:22 +0100, Wacek Kusnierczyk wrote: > >> Greg Snow wrote: >> >>> If it is fairly trivial to implement then go ahead and implement it, >>> >> patches are always welcome. >> >> now that's *not* true. not so long ago i submitted a patch

Re: [R] How to comment in R

2009-02-11 Thread Wacek Kusnierczyk
Duncan Murdoch wrote: > On 2/11/2009 2:27 PM, Wacek Kusnierczyk wrote: >> Duncan Murdoch wrote: >>> On 2/11/2009 1:21 PM, Stavros Macrakis wrote: On Wed, Feb 11, 2009 at 12:32 PM, Greg Snow wrote: > ...The c-style of /* */ allows both types and you can comment out > part of a lin

Re: [R] How to comment in R

2009-02-11 Thread Gavin Simpson
On Wed, 2009-02-11 at 20:22 +0100, Wacek Kusnierczyk wrote: > Greg Snow wrote: > > If it is fairly trivial to implement then go ahead and implement it, > patches are always welcome. > > now that's *not* true. not so long ago i submitted a patch improving on > Prof Brian Ripley's ad hoc fix to g

Re: [R] How to comment in R

2009-02-11 Thread Duncan Murdoch
On 2/11/2009 2:27 PM, Wacek Kusnierczyk wrote: Duncan Murdoch wrote: On 2/11/2009 1:21 PM, Stavros Macrakis wrote: On Wed, Feb 11, 2009 at 12:32 PM, Greg Snow wrote: ...The c-style of /* */ allows both types and you can comment out part of a line, but it is not simple to match and has its own

Re: [R] How to comment in R

2009-02-11 Thread Wacek Kusnierczyk
Greg Snow wrote: > Stavros, > > Thanks for the clarification and going further back in the credit for /* */. > > I don't think that the regex argument is a complete red herring (possibly a > pink herring or burnt umber herring?). The post I was responding to said > that implementing it would b

Re: [R] How to comment in R

2009-02-11 Thread Wacek Kusnierczyk
Duncan Murdoch wrote: > On 2/11/2009 1:21 PM, Stavros Macrakis wrote: >> On Wed, Feb 11, 2009 at 12:32 PM, Greg Snow wrote: >>> ...The c-style of /* */ allows both types and you can comment out >>> part of a line, but it is not simple to match and has its own >>> restrictions. Friedl in his regul

Re: [R] How to comment in R

2009-02-11 Thread Wacek Kusnierczyk
Stavros Macrakis wrote: > On Wed, Feb 11, 2009 at 12:32 PM, Greg Snow wrote: > >> ...The c-style of /* */ allows both types and you can comment out part of a >> line, but it is not simple to match and has its own restrictions. Friedl in >> his regular expressions book takes 10 pages to devel

Re: [R] How to comment in R

2009-02-11 Thread Wacek Kusnierczyk
Greg Snow wrote: > If it is fairly trivial to implement then go ahead and implement it, patches > are always welcome. now that's *not* true. not so long ago i submitted a patch improving on Prof Brian Ripley's ad hoc fix to grep, and it was silently ignored. in general, it should be fairly tr

Re: [R] How to comment in R

2009-02-11 Thread Greg Snow
essage- > From: macra...@gmail.com [mailto:macra...@gmail.com] On Behalf Of > Stavros Macrakis > Sent: Wednesday, February 11, 2009 11:22 AM > To: Greg Snow > Cc: waclaw.marcin.kusnierc...@idi.ntnu.no; Stephan Kolassa; > mihai.mira...@bafin.de; r-help@r-project.org > Subject:

Re: [R] How to comment in R

2009-02-11 Thread Duncan Murdoch
On 2/11/2009 1:21 PM, Stavros Macrakis wrote: On Wed, Feb 11, 2009 at 12:32 PM, Greg Snow wrote: ...The c-style of /* */ allows both types and you can comment out part of a line, but it is not simple to match and has its own restrictions. Friedl in his regular expressions book takes 10 pages

Re: [R] How to comment in R

2009-02-11 Thread Stavros Macrakis
On Wed, Feb 11, 2009 at 12:32 PM, Greg Snow wrote: > ...The c-style of /* */ allows both types and you can comment out part of a > line, but it is not simple to match and has its own restrictions. Friedl in > his regular expressions book takes 10 pages to develop a pattern to match > these (an

Re: [R] How to comment in R

2009-02-11 Thread Greg Snow
m: r-help-boun...@r-project.org [mailto:r-help-boun...@r- > project.org] On Behalf Of waclaw.marcin.kusnierc...@idi.ntnu.no > Sent: Wednesday, February 11, 2009 3:47 AM > To: Stephan Kolassa > Cc: mihai.mira...@bafin.de; r-help@r-project.org > Subject: Re: [R] How to comment in R > >

Re: [R] How to comment in R

2009-02-11 Thread baptiste auguie
On 11 Feb 2009, at 13:41, Gustaf Rydevik wrote: On Wed, Feb 11, 2009 at 2:15 PM, baptiste auguie wrote: A somewhat twisted approach that has not been mentioned is to consider everything a comment unless it is enclosed in special tags, as done in the brew package, for example, brew(te

Re: [R] How to comment in R

2009-02-11 Thread Gustaf Rydevik
On Wed, Feb 11, 2009 at 2:15 PM, baptiste auguie wrote: > A somewhat twisted approach that has not been mentioned is to consider > everything a comment unless it is enclosed in special tags, as done in the > brew package, > > for example, > > >> brew(textConnection( >> "You won't see this R outpu

Re: [R] How to comment in R

2009-02-11 Thread baptiste auguie
A somewhat twisted approach that has not been mentioned is to consider everything a comment unless it is enclosed in special tags, as done in the brew package, for example, brew(textConnection( "You won't see this R output, but it will run. <% foo <- 'bar' %> Now foo is <%=foo%> and toda

Re: [R] How to comment in R

2009-02-11 Thread Gabor Grothendieck
I think you need to revisit the suggestion of how to use Tinn-R to ensure you are doing it properly. If its R code then if(FALSE) has already been mentioned as an alternative and another possibility is just enclose it in double quotes (or if there are double quotes in the passage then in single qu

Re: [R] How to comment in R

2009-02-11 Thread Barry Rowlingson
2009/2/11 : > > Hi everybody, > > I use for the moment "#" at the begining of each line for comments. > > Is there any possibility to comment more than one line, like something which > shows the beggingng and the end of the comment? Or is there a possibility to > comment only a part of a line? >

Re: [R] How to comment in R

2009-02-11 Thread Wacek Kusnierczyk
(Ted Harding) wrote: > If a comment extends > over several lines, each one needs a "#". However, as has been > suggested, various text editors make it easier to do that. For > example, in 'vim': > > 1: Type in the several lines of comment (without "#"). Press 'Esc'. > 2. With the cursor in the firs

Re: [R] How to comment in R

2009-02-11 Thread bartjoosen
If you don't want to use the # before each comment line, you could try something like defining a function which returns nothing and then type some text after calling the function: comm <- function(x) {invisible()} comm("This is just a test, trying to comment without typing the hashes" ) But I d

Re: [R] How to comment in R

2009-02-11 Thread Ted Harding
*/ for begin/end comment in R. > > But if you choose Options -> Main -> Application in Tinn-R you can > specify whether you want a comment to start with # or ## or ### or ... > > S > > ____________________ > > Fra: mihai.mira...@bafin.de [mailto:

Re: [R] How to comment in R

2009-02-11 Thread Gábor Csárdi
t; An: Mirauta, Mihai; thierry.onkel...@inbo.be; r-help@r-project.org > Betreff: SV: [R] How to comment in R > > You CAN NOT use /* and */ for begin/end comment in R. > > But if you choose Options -> Main -> Application in Tinn-R you can specify > whether you want a comment to st

Re: [R] How to comment in R

2009-02-11 Thread Waclaw . Marcin . Kusnierczyk
> Hi Mihai, > > one (very bad style) way would be > > if (FALSE) { >comment >comment >comment > } > this works only if the enclosed text is syntactically valid r code. that is, you can't have multiline free text comments done this way, neither can you temporarily comment out unfinishe

Re: [R] How to comment in R

2009-02-11 Thread Waclaw . Marcin . Kusnierczyk
> Hi Mihai, > > one (very bad style) way would be > > if (FALSE) { >comment >comment >comment > } > this works only if the enclosed text is syntactically valid r code. that is, you can't have multiline free text comments done this way, neither can you temporarily comment out unfinishe

Re: [R] How to comment in R

2009-02-11 Thread Mihai.Mirauta
NKELINX, Thierry [mailto:thierry.onkel...@inbo.be] Gesendet: Mittwoch, 11. Februar 2009 09:55 An: Mirauta, Mihai; soren.hojsga...@agrsci.dk; r-help@r-project.org Betreff: RE: [R] How to comment in R Via the menu choose: Format --> Block --> Comment Or use the shortcut ke

Re: [R] How to comment in R

2009-02-11 Thread Stephan Kolassa
Hi Mihai, one (very bad style) way would be if (FALSE) { comment comment comment } But putting a # in front of every line is easier to spot in the code. HTH, Stephan mihai.mira...@bafin.de schrieb: Hi everybody, I use for the moment "#" at the begining of each line for comments. Is

Re: [R] How to comment in R

2009-02-11 Thread Mihai.Mirauta
@agrsci.dk] Gesendet: Mittwoch, 11. Februar 2009 11:03 An: Mirauta, Mihai; thierry.onkel...@inbo.be; r-help@r-project.org Betreff: SV: [R] How to comment in R You CAN NOT use /* and */ for begin/end comment in R. But if you choose Options -> Main -> Application in Tinn-R you can specify wh

Re: [R] How to comment in R

2009-02-11 Thread Søren Højsgaard
fin.de] Sendt: on 11-02-2009 10:54 Til: thierry.onkel...@inbo.be; Søren Højsgaard; r-help@r-project.org Emne: AW: [R] How to comment in R Still doesn't work. I did Format --> Block --> Comment and chose /* for begin comment, */ for end comment but R doesn't recognize the signs as suc

Re: [R] How to comment in R

2009-02-11 Thread ONKELINX, Thierry
f data. ~ John Tukey -Oorspronkelijk bericht- Van: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] Namens mihai.mira...@bafin.de Verzonden: woensdag 11 februari 2009 9:47 Aan: soren.hojsga...@agrsci.dk; r-help@r-project.org Onderwerp: Re: [R] How to comment in R I am using

Re: [R] How to comment in R

2009-02-11 Thread Mihai.Mirauta
I am using Tinn-R. -Ursprüngliche Nachricht- Von: Søren Højsgaard [mailto:soren.hojsga...@agrsci.dk] Gesendet: Mittwoch, 11. Februar 2009 09:40 An: Mirauta, Mihai; r-help@r-project.org Betreff: SV: [R] How to comment in R A hash (#) anywhere on a line will comment out the rest of the

Re: [R] How to comment in R

2009-02-11 Thread Mihai.Mirauta
Something like /*...*/ is what I am looking for ... -Ursprüngliche Nachricht- Von: Søren Højsgaard [mailto:soren.hojsga...@agrsci.dk] Gesendet: Mittwoch, 11. Februar 2009 09:40 An: Mirauta, Mihai; r-help@r-project.org Betreff: SV: [R] How to comment in R A hash (#) anywhere on a line

Re: [R] How to comment in R

2009-02-11 Thread Søren Højsgaard
to comment out several lines. Søren Fra: r-help-boun...@r-project.org på vegne af mihai.mira...@bafin.de Sendt: on 11-02-2009 09:32 Til: r-help@r-project.org Emne: [R] How to comment in R Hi everybody, I use for the moment "#" at the begining of ea

[R] How to comment in R

2009-02-11 Thread Mihai.Mirauta
Hi everybody, I use for the moment "#" at the begining of each line for comments. Is there any possibility to comment more than one line, like something which shows the beggingng and the end of the comment? Or is there a possibility to comment only a part of a line? Thanks, Mihai [