18.4 usethis::use_readme_rmd()

  • This function:
    • Creates a template README.Rmd file
    • File has a yaml header which outputs into a github_document
    • Adds the .Rmd file to .Rbuildignore (as we just want our README.md included)
  • If we need to make changes to the README file, we will edit the .Rmd file and render it (use devtools::build_readme()) to generate the updated .md file
  • If your package is also a git repo, then there is a neat pre-commit hook that compares the .Rmd file to the .md file
    • if the .Rmd file is more recent than the .md file, it will show a warning:
     > README.md is out of date; please re-knit README.Rmd