benmarwick / rrtools

rrtools: Tools for Writing Reproducible Research in R
Other
668 stars 84 forks source link

Adjust README to chosen file structure #152

Open bbartholdy opened 1 year ago

bbartholdy commented 1 year ago

This is a very small thing and may not be worth implementing, but maybe worth bringing attention.

Following a call to use_readme_rmd(), the generated README will include the ## Contents section with a reference to the analysis directory. However, the user is also given the option to use "inst" and "vignettes" as location arguments in the use_analysis() function. This will result in broken links in the "## Contents" section of the generated README files.

## Contents

The **analysis** directory contains:

- [:file_folder: paper](/analysis/paper): R Markdown source document for
  manuscript. Includes code to reproduce the figures and tables
  generated by the analysis. It also has a rendered version,
  `paper.docx`, suitable for reading (the code is replaced by figures
  and tables in this file)
- [:file_folder: data](/analysis/data): Data used in the analysis.
- [:file_folder: figures](/analysis/figures): Plots and other
  illustrations
- [:file_folder:
  supplementary-materials](/analysis/supplementary-materials):
  Supplementary materials including notes and other documents prepared
  and collected during the analysis.

A quick solution would just be to add a warning that users may need to fix these links when using the "inst" and "vignettes" arguments.

A more comprehensive solution would be to generate the README filepaths based on what structure the user has already implemented (i.e. analysis/ or inst/). Although I'm not sure how feasible this is (for example if the user generates the README before using use_analysis()).

benmarwick commented 5 months ago

Yes, good observation, I agree with the need for this, though I have no idea frequently any of the options are used (I'm 'analysis' all the way, what is everyone else doing?). A pull request for the comprehensive solution that you mention would be most welcome!