3

I am getting following error while Knit my RMarkdown file.

Parser error: while parsing a block mapping at line 1, column 1 did not find expected key at line 2, column 11
Calls: <Anonymous> ... parse_yaml_front_matter -> yaml_load -> <Anonymous>
Execution halted*

I understand it's my yaml header which is following -

---
title: "Data Wrangling Assessment"
author: ""ABC 11111""
subtitle: 
output: 
  word_document: default
  html_document:
    df_print: paged
  html_notebook: default
---

Can anyone please help me to troubleshoot?

alan ocallaghan
  • 3,116
  • 17
  • 37

1 Answers1

1

The issue is that you wrapped the author name in doubled double quotes. If you want to quote the author name you have to

  1. escape the inner double quotes using \", e.g. "\"ABC 11111\""
  2. replace the outer double quotes with single quotes, e.g. '"ABC 11111"'

---
title: "Data Wrangling Assessment"
author: "\"ABC 11111\""
subtitle: 
output: 
  word_document: default
  html_document:
    df_print: paged
  html_notebook: default
---

enter image description here

stefan
  • 90,330
  • 6
  • 25
  • 51