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] detect and respect names #86

Open
dhicks opened this issue Sep 5, 2022 · 1 comment
Open

[feature request] detect and respect names #86

dhicks opened this issue Sep 5, 2022 · 1 comment

Comments

@dhicks
Copy link

dhicks commented Sep 5, 2022

If here() is passed a named character vector, the names are discarded.

library(here)

foo = c(a = '1', b = '2')
here(foo)

Detecting names, and passing them along to the output, would be useful for pipes that start by searching for files and then opening them, eg,

list.files(data_dir, 'csv') |> 
    set_names() |>
    here(data_dir, _) |> 
    map_dfr(read_csv, .id = 'file')
@krlmlr
Copy link
Member

krlmlr commented Sep 7, 2022

Thanks, good idea! If we do it, it should be part of rprojroot.

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