[R] Obtaining exact pattern in list.files()

Ista Zahn |@t@z@hn @end|ng |rom gm@||@com
Wed Sep 12 15:07:44 CEST 2018


pattern = "^File$"

Best,
Ista
On Wed, Sep 12, 2018 at 7:53 AM Christofer Bogaso
<bogaso.christofer using gmail.com> wrote:
>
> Hi,
>
> In the list.files() function, there is an argument 'pattern' to locate the
> desired files. However I failed to see if I can manage to fetch those files
> that having an exact match.
>
> For example, if there are 2 files that contain the expression 'File' and
> 'Second_File', then I should get the 1st one. However R is returning both
> the files.
>
> 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
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.




More information about the R-help mailing list