3
How to automatically include the current system date in the title of the document to be compiled by R-markdown
?
When I try to include the system date in the field date
through the YAML code: r format(Sys.time(), "%d de %B de %Y")
, I get an error message:
---
title: "Exemplo"
author: "Socrates"
date: `r format(Sys.Date(), "%d de %B de %Y")`
output: html_document
---
Error in yaml::yaml.load(..., eval.expr = TRUE) :
Scanner error: while scanning for the next token at line 3, column 7 found character that cannot start any token at line 3, column 7
Calls: <Anonymous> ... parse_yaml_front_matter -> yaml_load -> <Anonymous>
Execução interrompida
Note: Question and answer adapted from the Soen, for systems with language settings in Portuguese.