In my R file I have:
library(rmarkdown)
rmarkdown::render("C://Users//me//Desktop//test_param.Rmd",
params = list(region = "west"))
and in the rmd file:
---
title: "test"
output: pdf_document
params:
name: "test"
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
```
`r params$name`
that rmd works when I run in separately.
BUT when I run the .r file I get this error
Error in knit_params_get(input_lines, params) :
render params not declared in YAML: region
what's the reason for this error?