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

Feature request: here() that keeps paths short with RProjects #104

Open
bpfree opened this issue Feb 14, 2024 · 3 comments
Open

Feature request: here() that keeps paths short with RProjects #104

bpfree opened this issue Feb 14, 2024 · 3 comments

Comments

@bpfree
Copy link

bpfree commented Feb 14, 2024

Neat package to have pathnames work across Macs and Windows. Curious if there exists a plan to have here() get integrated with RProjects to keep pathnames short.

For instance RProjects would produce a pathname that would look like: data/a_raw_data/subdirectory/dataset.gpkg.

here::here() for a similar location would produce something like: users/USER/documents/project/data/a_raw_data/subdirectory/dataset.gpkg

Does this make sense? Being able to combine here with RProject would provide a powerful collaborative capability between colleagues using different operating systems.

@krlmlr
Copy link
Member

krlmlr commented Feb 14, 2024

Thanks. What is RProjects?

@bpfree
Copy link
Author

bpfree commented Feb 15, 2024

It is a nice feature of RStudio. Many benefits, but a significant one is the ability to have version control with Git and have streamlined pathnames for directories and data. RProjects are often self-contained.

@krlmlr
Copy link
Member

krlmlr commented Feb 15, 2024

Are you looking for fs::path_rel() ?

library(here)
#> here() starts at /Users/kirill/git/R/fledge

path <- here::here("R/auto.R")
path
#> [1] "/Users/kirill/git/R/fledge/R/auto.R"

fs::path_rel(path)
#> R/auto.R

Created on 2024-02-15 with reprex v2.1.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants