[R] Obtaining exact pattern in list.files()
jdnewm|| @end|ng |rom dcn@d@v|@@c@@u@
Wed Sep 12 15:20:53 CEST 2018
Study regular expressions via ?regex or any of the many websites you can find with a search engine. With no special characters, your search pattern matches anywhere in the string. Start your study by learning about the ^ and $ characters.
On September 12, 2018 4:53:09 AM PDT, Christofer Bogaso <bogaso.christofer using gmail.com> wrote:
>In the list.files() function, there is an argument 'pattern' to locate
>desired files. However I failed to see if I can manage to fetch those
>that having an exact match.
>For example, if there are 2 files that contain the expression 'File'
>'Second_File', then I should get the 1st one. However R is returning
>Any pointer on how to achieve that would be helpful. Thanks,
> [[alternative HTML version deleted]]
>R-help using r-project.org mailing list -- To UNSUBSCRIBE and more, see
>PLEASE do read the posting guide
>and provide commented, minimal, self-contained, reproducible code.
Sent from my phone. Please excuse my brevity.
More information about the R-help