I would like to dynamically change the text of an R markdown report template I'm using depending on certain inputs. I'm calling knitr from the PowerShell.
This is the input I would like to insert into the R markdown text Input:
{
"start": "1/21/2015",
"end": "1/23/2015",
"species: ["RBHS", "DBHS", "CBHS"]
}
.Rmd file
---
title: "Capture Report"
author: "Mitchell Gritts"
date: Sys.Date()
output: html_document
---
```{r load packages, include = FALSE}
LoadScripts()
```
## Capture Table
All SPECIESLIST captured between STARTDATE and ENDDATE are included
in the table. Data included in the table are Species, NDOW ID, Sex, Age,
Marks and Collar information.
SPECIESLIST, STARTDATE and ENDDATE are to be replaced with the values from the input.
Is there a way to do this with knitr
or sweave
. Or do I use search and replace functions to do this?