简体   繁体   中英

Can't knit in R markdown

Recently I was doing a course in Coursera and faced the problem while doing R markdown. When I run the code in the console it works just fine however, when I knit it, the rmarkdown only show text in the code chunk as below.

I run this in console and it work just fine: 在此处输入图像描述

But when i knit the code appear as text: 在此处输入图像描述

When I hit the green arrow it appears like there are some error going on: 在此处输入图像描述

The bottom screenshot you provided is not an R code chunk. It does not have the proper header. R code chunks in an R markdown file must be formatted like this:

```{r}
R code goes here
```

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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