[R] Extracting File Basename without Extension

Berwin A Turlach berwin at maths.uwa.edu.au
Fri Jan 9 14:46:37 CET 2009


G'day Wacek,

On Fri, 09 Jan 2009 14:22:19 +0100
Wacek Kusnierczyk <Waclaw.Marcin.Kusnierczyk at idi.ntnu.no> wrote:

> > Apparently also a possibility, I guess it can be made to work with
> > the original example and my extensions.
> >   
> 
> i guess it does work with the original example and your extensions.

And I thought that you would have known for sure.....

> > Though, it seems to require the knowledge of perl, or at least
> > perl's regular expression.    
> 
> oh my, sorry.  it' so bad to go an inch out of the cosy world of r. 

Well, if that's how you feel, don't do it.

I regularly use other languages besides R.  Mostly C and Fortran,
occasionally Python.  But I never found time to learn Perl or Java or
awk or C++ or....; some people do not have the time to learn all
languages under the sun. Also, if one concentrates on a few, one can
learn them really well.

> but, as gabor pointed, 'perl=TRUE' is inessential here,

I thought that your answer to Gabor indicated that, depending on the
context, perl=TRUE was essential; though I must admit that I did not
run that code.  

> so you actually need to know just (very basic) regular expressions,
> with no 'perl' implied.  having learnt this simple regex syntax you
> can avoid the need for looking up strsplit and paste in tfm, so i'd
> consider it worthwhile.

As people say, YMMV, I do not need to look up strsplit and/or paste;
but I would have to look up what the regular expression syntax or
finally memorise it; something I did not consider worthwhile so far.

Cheers,

	Berwin




More information about the R-help mailing list