Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Suboptimal regex for pattern in list.files #11

Open
jwe4ec opened this issue Mar 24, 2022 · 0 comments
Open

Suboptimal regex for pattern in list.files #11

jwe4ec opened this issue Mar 24, 2022 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@jwe4ec
Copy link
Collaborator

jwe4ec commented Mar 24, 2022

Multiple scripts use list.files with pattern = "*.csv" to obtain all CSV file names in a folder. However, even when using R4.0.3, which was used to write the scripts, RStudio 2022.02.0 Build 443 returns NULL when using this pattern on Windows 10 Pro.

The issue appears due to an incompatibility between the regular expression engines for R versus RStudio. See here and here.

However, even once the incompatibility is fixed in an RStudio update, it also seems that pattern = "*.csv" is not optimal. Consider other patterns that may be better, such as pattern = "\\.csv$". This works on Windows 10 Pro but needs testing on Mac.

@jwe4ec jwe4ec added the bug Something isn't working label Mar 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants