Yaml trouble at knit

Hi! I have the next error when I try to knit my Rmd to a pdf or html:

"Error in yaml::yaml.load(..., eval.expr = TRUE) : **
** Scanner error: while scanning for the next token at line 3, column 30 found character that cannot start any token at line 3, column 30

Calls: ... parse_yaml_front_matter -> yaml_load -> "

The code that give that at line 3 is my name:

1 ---
2 title: "RMarkdown"
3 author: "Juan Carlos Ortega Velasco"
4 date: "r format(Sys.Date(),"%e de %B, %Y")"

I saw a similar topic and it was solved deleting the yaml package and reinstalling it, but in my case it doesn't work.

Does anybody know what happen with yaml??

Thanks!!

Hi, thanks!

The numbers were put by me to make esier the visualization of the lines.

This is the screenshot of RStudio.

The issue is here. The correct syntax for this is :

---
title: "RMarkdown"
author: "Juan Carlos Ortega Velasco"
date: "`r format(Sys.Date(),'%e de %B, %Y')`"
---
  • You can't use double quote inside double quote. it is either "'something'" or '"something"'
  • You need to use a `r for knitr to know it is inline code

See

2 Likes

Thanks! That's it

Now, it works. I'll take a look to the Cookbook!

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.