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')
If
here()is passed a named character vector, the names are discarded.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,