yaml header for package vignette to retain .md output

Viewed 67

I have an R package containing vignettes with examples. The package is on GitHub and checked by Travis.

My vignettes knit fine to .Rmd. But I have examples whose output I want to show, and that's not present in the .Rmd output. For instance, in the dplyr.Rmd vignette, there are lots of code chunks but no outputs when viewing in the browser.

My workaround: I've been knitting to .Md, which shows the printed outputs, and then manually saving the .Md files into my repository to share with users. I'd like this to be automated.

Can I accomplish this with a YAML header? My goal:

  • Generate .Md file for viewing in the browser
  • Generate .Rmd file as well
  • Pass devtools::check() and on Travis-CI

I've tried combinations of keep_md: yes and

output: 
  md_document: 
    variant: markdown_github 

etc.

0 Answers
Related