listing all files in a directory ending in ".xxx" in a script

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

listing all files in a directory ending in ".xxx" in a script

J C Nash
When in a console (I was in Rstudio) I can run

dir("../provenance-of-rootfinding/", pattern="\\.Rmd")

to list all Rmd files in the specified directory.

However, when I try to run this in a script under

   Rscript --vanilla

I don't get the files to list.

Am I missing something obvious that I should know about?

JN

______________________________________________
[hidden email] 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.
Reply | Threaded
Open this post in threaded view
|

Re: listing all files in a directory ending in ".xxx" in a script

J C Nash
Apologies for list noise. I just found a subtle typo so the command
was different from what it appeared to be in the actual use-case.
dir() seems to be working OK once that was fixed.

JN



-------- Forwarded Message --------
Subject: listing all files in a directory ending in ".xxx" in a script
Date: Fri, 14 Dec 2018 19:33:25 -0500
From: J C Nash <[hidden email]>
To: r-help <[hidden email]>

When in a console (I was in Rstudio) I can run

dir("../provenance-of-rootfinding/", pattern="\\.Rmd")

to list all Rmd files in the specified directory.

However, when I try to run this in a script under

   Rscript --vanilla

I don't get the files to list.

Am I missing something obvious that I should know about?

JN

______________________________________________
[hidden email] 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.