动态更改knitr .Rmd报告文本

时间:2015-09-15 23:21:17

标签: r knitr r-markdown

我想根据某些输入动态更改我正在使用的R降价报告模板的文本。我在PowerShell中调用knitr。

这是我要插入R markdown文本输入的输入:

{
  "start": "1/21/2015",
  "end": "1/23/2015",
  "species: ["RBHS", "DBHS", "CBHS"]
}

.Rmd文件

---
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和ENDDATE将替换为输入中的值。

有没有办法通过knitrsweave执行此操作。或者我使用搜索和替换功能来执行此操作?

0 个答案:

没有答案