Re: [R] Pattern match in R

2008-09-30 Thread Gabor Grothendieck
Try this where ? signifies that the prior character is optional: dir(pattern = "^Coverage_[1-9]?[0-9]$") On Tue, Sep 30, 2008 at 10:36 AM, bioinformatics_guy <[EMAIL PROTECTED]> wrote: > > I want to make sure this piece of code I wrote is doing what I want it to do. > > ll<-function(string) > {

Re: [R] Pattern match in R

2008-09-30 Thread Ted Harding
On 30-Sep-08 14:36:04, bioinformatics_guy wrote: > I want to make sure this piece of code I wrote is doing what > I want it to do. > > ll<-function(string) > { > grep(string,dir(),value=T) > } > > subdir = ll("Coverage_[1-9][0-9]$") > > I basically wrote a little function that would grab a

Re: [R] Pattern match in R

2008-09-30 Thread Richard . Cotton
> I want to make sure this piece of code I wrote is doing what I want it to do. > > ll<-function(string) > { >grep(string,dir(),value=T) > } > > > subdir = ll("Coverage_[1-9][0-9]$") > > I basically wrote a little function that would grab all the files of form > Coverage_[0-99] > > The w

[R] Pattern match in R

2008-09-30 Thread bioinformatics_guy
I want to make sure this piece of code I wrote is doing what I want it to do. ll<-function(string) { grep(string,dir(),value=T) } subdir = ll("Coverage_[1-9][0-9]$") I basically wrote a little function that would grab all the files of form Coverage_[0-99] The way I wrote it, will it g