I have a report in R which generates charts and has some text. The text contains a reference to the previous week which is is itself based on a dataframe
I cant get it to run. Below is the code. Does anyone see the problem
I get the following error message
Error in yaml::yaml.load(enc2utf8(string), ...) : Scanner error: mapping values are not allowed in this context at line 5, column 9 Calls: ... yaml_load_utf8 -> mark_utf8 -> -> .Call Execution halted
---
title: "Foo"
author: "John Smith"
date: "18 October 2016"
output: word_document
params:
weeknr: !r max(data$WEEKNRs)
---
```{r}
# creates the dataframe referenced in the header
source('transform.R')
```
All,
Please find below [attached](www.stackexchange.com) report for week ``r params$weeknr``
render(rmarkdowndoc.rmd,params=(weeknr=max(data$WEEKNRs))- Morgan Balldata. By sourcing transform.R it should create the dataframe and store it within the file? Would Rmarkdown be able to pick this up? In your second comment, thus this information get put into an R Chunk? - John Smithweeknr: !r max(source(transform.R)$WEEKNRs)or it might need to be this if transform.R returns a listweeknr: !r max(source(transform.R)[[1]]$WEEKNRs)- Morgan Ball