简体   繁体   English

R markdown 不能编织

[英]R markdown can't knit

I finished a project in R markdown and all I have to do is knit it as a word document, but there's this message error that I can't understand where I have made the mistake.我在 R markdown 完成了一个项目,我所要做的就是把它编织成一个 word 文档,但是有这个消息错误,我不明白我在哪里犯了错误。

Error in yaml::yaml.load(..., eval.expr = TRUE): Scanner error: mapping values are not allowed in this context at line 4, column 22 Calls: ... parse_yaml_front_matter -> yaml_load -> Execution halted yaml::yaml.load(..., eval.expr = TRUE) 中的错误:扫描仪错误:在第 4 行第 22 列的上下文中不允许映射值调用:... parse_yaml_front_matter -> Execution_load -

I looked at line 4 and it's just the date of the project and line 22 is an empty line so they're not the issue.我查看了第 4 行,它只是项目的日期,第 22 行是空行,所以它们不是问题。 Can anyone translate what the error means?任何人都可以翻译错误的含义吗? Is it one of the chunk codes or any other error?它是块代码之一还是任何其他错误? Please and thank you These are the first 22 lines of the code(the language used is my country's language, just information):请和谢谢这些是代码的前 22 行(使用的语言是我国的语言,仅供参考):

---
title: "Diferencimi gjinor ne aspekte ekonomike dhe sociale ne Shqiperi"
author: "Selina Balla(lider), Sindi Gjura, Sara Osmrija"
date: "June 17, 2021"
output: word_document: default
---
# "Diferencimi gjinor ne aspekte ekonomike dhe sociale ne Shqiperi"
### Hyrje
Pabarazia prek cdo fushe te jetes. Statistikat gjinore reflektojne ndryshimet ose pabarazite e situates se burrave dhe grave ne spektra te ndryshem. Gjendja e meshkujve dhe femrave tregohet me ane te statistikave ne fusha te tilla si popullsia, arsimi, tregu i punes, perfshirja sociale, shendetesia dhe vendimmarrja. Njohja e situates se femrave dhe meshkujve ne shoqeri, ne te gjitha sferat e jetes orienton politikberesit drejt vendimarrjeve te duhura mbi keto politika. 
Nentemat e perzgjedhura per tu prezantuar pasqyrojne diferencimin ne fusha ekonomike apo sociale qe behet per shkak te gjinise se individeve. Paraqitjet grafikore do te jene celesi per te dalluar ritmet e arritjes se barazise gjinore ne Shqiperi. Te dhenat e marra perfshijne te gjithe popullsine e Shqiperise, nga e cila 50.17% jane femra dhe 49.83% meshkuj.


Fjale kyce: pabarazi, arsim, ekonomi, social.


### Qellimi
Permes ketij studimi, mendohet te arrihet nje ndergjegjesim tek ajo pjese e popullsise e cila ben diferencim te aftesive fizike, mendore etj. midis individeve ne baze te gjinise dhe jo vertete ne baze te kualifikimeve. Ajo qe sherben si nje nga qellimet primare te ketij projekti eshte nxitja e njerezve per te kundershtuar kete pabarazi, per te permiresuar kushtet aktuale te shoqerise. Ne kete menyre, arrihet nje diversitet ideologjik ne pikepamje te ndryshme te jetes. 



###Arsimi

Indentation and newlines are important in YAML, change your header to缩进和换行在 YAML 中很重要,将 header 更改为

---
title: "Diferencimi gjinor ne aspekte ekonomike dhe sociale ne Shqiperi"
author: "Selina Balla(lider), Sindi Gjura, Sara Osmrija"
date: "June 17, 2021"
output:
  word_document:
    default
---

Demonstration:示范:

yaml::read_yaml(text='---
title: "Diferencimi gjinor ne aspekte ekonomike dhe sociale ne Shqiperi"
author: "Selina Balla(lider), Sindi Gjura, Sara Osmrija"
date: "June 17, 2021"
output: word_document: default
---')
# Error in yaml.load(string, error.label = error.label, ...) : 
#   Scanner error: mapping values are not allowed in this context at line 5, column 22

### fixed
yaml::read_yaml(text='---
title: "Diferencimi gjinor ne aspekte ekonomike dhe sociale ne Shqiperi"
author: "Selina Balla(lider), Sindi Gjura, Sara Osmrija"
date: "June 17, 2021"
output:
  word_document:
    default
---')
# $title
# [1] "Diferencimi gjinor ne aspekte ekonomike dhe sociale ne Shqiperi"
# $author
# [1] "Selina Balla(lider), Sindi Gjura, Sara Osmrija"
# $date
# [1] "June 17, 2021"
# $output
# $output$word_document
# [1] "default"

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM