This repo contains some reprex code that Jenny Bryan helped me troubleshoot re reading in several excel files and adding a filename variable to each. It was a smelly path problem; check out the many solutions at this github pages site.
README
This repo is designed to help me replicate/troubleshoot problems I have been having with code that uses map and read_excel to read in several .xlsx files, add a filename variable to each. The data folder contains dummy data.
The code is in an Rmd document and works when the .Rmd is located within the data folder (map_readexcel_in_data_folder.Rmd). But when I try and run the same code outside of the data folder (map_readexcel_in_project_folder.Rmd), it throws an error.
Error: `path` does not exist: ‘fruitdata1.xlsx’
It definitely smells like a project/filepath/here::here problem, but I can't work it out.
UPDATE: it was a smelly path problem but thanks to Jenny Bryan I now know lots more about paths. Check out the many solutions here:
https://jenrichmond.github.io/map_excel_reprex/