Re: [R] grep in filename

2007-10-04 Thread Charles C. Berry
On Thu, 4 Oct 2007, Alberto Monteiro wrote: > Is there any version of grep that gets information from the filename? > > For example: > x <- "myfile.txt" > y <- grep.file("my text", x) > should return in y the lines with my text. > > I know that > x <- "myfile.txt" > y <- grep("my text", readLines(

[R] grep in filename

2007-10-04 Thread Alberto Monteiro
Is there any version of grep that gets information from the filename? For example: x <- "myfile.txt" y <- grep.file("my text", x) should return in y the lines with my text. I know that x <- "myfile.txt" y <- grep("my text", readLines(x)) will probably work, but maybe there's a more direct (and le