I am trying to create a parameterized report in R Markdown based on the following tutorial: http://rmarkdown.rstudio.com/developer_parameterized_reports.html#passing-parameters
I'm trying to pass a file path as a parameter from the r console using render. Like this:
render('rmarkdownfile.rmd',params= list( client= "clientdata.csv"))
and my markdown file looks like this:
title: "Liquidity Report"
output: pdf_document
params: client:"clientdata.csv"
---
```{r plot, echo=FALSE, warning=FALSE}
cftest <- read.csv(params$client)
But I get an error that says:
Eror in read.table(file=file, header=header, sep=sep, quote=quote, : 'file' must be a character string or connection Calls:
It seems like Markdown is not recognizing the parameters even though I'm following the steps of the tutorial. Has anyone been able to successfully use parameters in R Markdown?
Also, I'm following the recommendations of the tutorial and am using the R Studio preview as well as the latest builds of r markdown and knitr.
Thank you for the help!
Rafael