You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on May 19, 2021. It is now read-only.
Working with filepaths in R is a total pain in the ass, mainly because we treat them exclusively as character vectors. This means we're stuck parsing filepaths with messy regexes at best, and still no way of reliably building filepaths apart from string concatenation. There's also no way of building relative and absolute paths reliably.
I propose a package with a Path object that provides us structured filepaths and methods in a similar way to Ammonite's Path object in Scala. For some concrete examples of this, you can see Li Haoyi demonstrating it at minute 18 of his A Better Scala REPL talk.
This package could have implementations of list.files, list.dirs, getwd and so on, or Path could provide a factory method for parsing their outputs so we could still use them like list.files() %>% Path.
I believe the current state of filepaths is a real pain point, and think a solution like this would be a good direction, but am obviously open to discussing other solutions!
The text was updated successfully, but these errors were encountered:
Working with filepaths in R is a total pain in the ass, mainly because we treat them exclusively as character vectors. This means we're stuck parsing filepaths with messy regexes at best, and still no way of reliably building filepaths apart from string concatenation. There's also no way of building relative and absolute paths reliably.
I propose a package with a
Path
object that provides us structured filepaths and methods in a similar way to Ammonite's Path object in Scala. For some concrete examples of this, you can see Li Haoyi demonstrating it at minute 18 of his A Better Scala REPL talk.This package could have implementations of
list.files
,list.dirs
,getwd
and so on, orPath
could provide a factory method for parsing their outputs so we could still use them likelist.files() %>% Path
.I believe the current state of filepaths is a real pain point, and think a solution like this would be a good direction, but am obviously open to discussing other solutions!
The text was updated successfully, but these errors were encountered: