Re: [R] R2.1.0: Bug in list.files

From: Gabor Grothendieck <ggrothendieck_at_gmail.com>
Date: Thu 12 May 2005 - 21:41:11 EST

Note that sfsmisc::glob2rx is a handy function that will convert glob style wildcard expressions to regular expressions.

On 5/12/05, Steve Roberts <steve.roberts@manchester.ac.uk> wrote:
> Yes I missed the NEWS entry - or rather didn't realise its significance.
> So the "bug" was in the previous version and my old code which worked
> but shouldn't have.
>
> Thanks for the replies - rapid and to the point as usual.
>
> Steve.
>
> Date sent: Thu, 12 May 2005 10:45:03 +0200
> From: Uwe Ligges <ligges@statistik.uni-dortmund.de>
> Organization: Fachbereich Statistik, Universitaet Dortmund
> To: steve.roberts@manchester.ac.uk
> Copies to: R-help@stat.math.ethz.ch
> Subject: Re: [R] R2.1.0: Bug in list.files
>
> > Steve Roberts wrote:
> >
> > > R2.0.1 (MS Windows)
> > >
> > >
> > >>list.files(myloc,"*.zip",full=T)
> > >
> > > [1] "P:/SARsoftware/Rlibraries/gnlm_0.1.zip"
> > > [2] "P:/SARsoftware/Rlibraries/lms2_0.2.zip"
> > >
> > >
> > > R2.1.0:
> > >
> > >
> > >>list.files(myloc,"*.zip",full=T)
> > >
> > > Error in list.files(path, pattern, all.files, full.names, recursive)
> > > :
> > > invalid 'pattern' regular expression
> > >
> > > Bug? or have I missed something
> >
> > You missed to read the NEWS that tells you:
> >
> > o The regular expression code is now based on that in glibc
> > 2.3.3. It has stricter conformance to POSIX, so metachars such as
> > { } + * may need to be escaped where before they did not (but
> > could have been).
> >
> >
> > Probably you want
> >
> > list.files(pattern = "\\.zip$", full.names = TRUE)
> >
> > Uwe Ligges
> >
> >
> > > Steve.
> > > Dr Steve Roberts
> > > steve.roberts@manchester.ac.uk
> > >
> > > Senior Lecturer in Medical Statistics,
> > > CMMCH NHS Trust and University of Manchester Biostatistics Group,
> > > 0161 275 5192/5764 / 0161 276 5785
> > >
> > > ______________________________________________
> > > R-help@stat.math.ethz.ch mailing list
> > > https://stat.ethz.ch/mailman/listinfo/r-help
> > > PLEASE do read the posting guide!
> > > http://www.R-project.org/posting-guide.html
> >
>
> Dr Steve Roberts
> steve.roberts@manchester.ac.uk
>
> Senior Lecturer in Medical Statistics,
> CMMCH NHS Trust and University of Manchester Biostatistics Group,
> 0161 275 5192/5764 / 0161 276 5785
>
> ______________________________________________
> R-help@stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
>



R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html Received on Thu May 12 21:49:51 2005

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:31:44 EST