[R] Perl "cut" equivalent in R

David Winsemius dwinsemius at comcast.net
Thu Dec 2 01:12:37 CET 2010


On Dec 1, 2010, at 6:59 PM, Jonathan Flowers wrote:

> Thanks Sarah, you are right.  In perl,  "cut" serves the function of
> eliminating a block of code from being executed in a script.  When  
> "=cut" is
> placed above and below the code that you do not wish to execute then  
> the
> interpreter will skip over the code.  There are lots of ways to  
> solve the
> problem, but cut is a handy solution.

The question now sounds analogous to questions that have been raised  
in the past requesting a block comment feature. There isn't one. There  
are a variety of work-arounds but the usual response has been: figure  
out how to do it (meaning line-by-line "#" insertions)  with your  
editor.

One of the workarounds... the one I remember anyway...  has been to  
insert:

if(FALSE) {
stuff your don't want executed
          }


(There is of, course, a cut function and it is for a very different  
purpose.)
-- 
David

>
> Thanks.
>
> On Wed, Dec 1, 2010 at 6:31 PM, Sarah Goslee  
> <sarah.goslee at gmail.com> wrote:
>
>> It would help if you told us what you wanted this function to do,
>> and provided an example. Not everyone speaks Perl.
>>
>> Sarah
>>
>> On Wed, Dec 1, 2010 at 6:10 PM, Jonathan Flowers
>> <jonathanmflowers at gmail.com> wrote:
>>> Does anyone know of a command in R that is equivalent to the =cut
>> function
>>> in Perl?
>>>
>>> Thanks.
>>>
>>> Jonathan
>>>
>>
>> --
>> Sarah Goslee
>> http://www.functionaldiversity.org
>>
>
> 	[[alternative HTML version deleted]]
>
> ______________________________________________
> 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.

David Winsemius, MD
West Hartford, CT



More information about the R-help mailing list