Hi, I always use dir(pattern="*.RData") in all the earlier version of R (1.8, 1.9, 2.0.1). Error messege is as below: Error in list.files(path, pattern, all.files, full.names, recursive) : invalid 'pattern' regular expression Does anyone have an idea what's going on? How should I define the pattern I need in R-2.1.0? Thanks! Bin
The new version of R has begun enforcing rules on regular expressions. Your pattern is not a valid regular expression, hence it no longer works. The meaning of '*' is with respect to a preceding character, hence it is ill-defined without one. On Mon, 25 Apr 2005, Ye, Bin wrote:> Hi, > > I always use dir(pattern="*.RData") in all the earlier version of R (1.8, 1.9, 2.0.1). > > Error messege is as below: > Error in list.files(path, pattern, all.files, full.names, recursive) : > invalid 'pattern' regular expression > > Does anyone have an idea what's going on? How should I define the pattern I need in R-2.1.0? > > Thanks! > > > Bin > > ______________________________________________ > R-help at 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 >
On 4/25/05, Ye, Bin <yeb@karmanos.org> wrote:> > Hi, > > I always use dir(pattern="*.RData") in all the earlier version of R (1.8, > 1.9, 2.0.1). > > Error messege is as below: > Error in list.files(path, pattern, all.files, full.names, recursive) : > invalid 'pattern' regular expression > > Does anyone have an idea what's going on? How should I define the pattern > I need in R-2.1.0? > > Thanks! > > BinCheck out sfsmisc::glob2rx for a nifty function that will convert glob style wildcards to regular expressions. I have long th [[alternative HTML version deleted]]