Re: [R] grep fixed (?) in 2.14

2011-11-03 Thread Stephen Sefick
That did the trick. I have read about regular expressions often, and sometimes I get them right and sometimes I don't. Is there a good reference resource that anyone could suggest? Thanks for all of the help. Stephen Sefick On 11/03/2011 08:03 AM, jim holtman wrote: your syntax is wrong,

Re: [R] grep fixed (?) in 2.14

2011-11-03 Thread jim holtman
your syntax is wrong, you need: scripts2source[grep("*\\.R$", scripts2source)] Notice the '\\.' to escape the special meaning of '.', and the "$" to anchor to the end of the line. On Thu, Nov 3, 2011 at 8:54 AM, Stephen Sefick wrote: > #This is probably due to my incomplete understanding of g

Re: [R] grep fixed (?) in 2.14

2011-11-03 Thread Sarah Goslee
Hi, . and * both mean something different in regular expressions than in command-line wildcards. You need: grep(".*\\.R$", scripts2source) which parses to .- any character *- any number of times \\. - an actual . escaped as R requires R - the R denoting a script $ - at the end of the

[R] grep fixed (?) in 2.14

2011-11-03 Thread Stephen Sefick
#This is probably due to my incomplete understanding of grep, but the below code has been working for some time to #search for .R with anything in front of it and return a list of scripts to source. Likely, the syntax for the #grep statement has been wrong all along. scripts2source <- (c("/hom