Closed perlatex closed 3 years ago
在 index.Rmd 加载的R宏包 ,后面章节用不上呢?比如在index.Rmd
library(tidyverse) library(palmerpenguins)
而在01-intro.Rmd
penguins %>% head(4) %>% knitr::kable( caption = 'Here is a nice table!', booktabs = TRUE )
会报错 Error in penguins %>% head(4) %>% knitr::kable(caption = "Here is a nice table!", : û��"%>%"������� Calls: local ... handle -> withCallingHandlers -> withVisible -> eval -> eval
Error in penguins %>% head(4) %>% knitr::kable(caption = "Here is a nice table!", : û��"%>%"������� Calls: local ... handle -> withCallingHandlers -> withVisible -> eval -> eval
如果,在01-intro.Rmd 写全却可以
library(tidyverse) library(palmerpenguins) penguins %>% head(4) %>% knitr::kable( caption = 'Here is a nice table!', booktabs = TRUE )
Bookdown 有两个处理方式:merge-knit 和 knit-merge。默认的是 merge-knit。要换成后者,可以在 _boodown.yaml 里添加 new_session: yes 。ElegantBookdown 选择了 knit-merge 的方式。而你想要的应该是默认的方式,所以你可以将 _bookdown.ymal 里的这一行注释掉,或者删除。
merge-knit
knit-merge
_boodown.yaml
new_session: yes
_bookdown.ymal
很棒
在 index.Rmd 加载的R宏包 ,后面章节用不上呢?比如在index.Rmd
而在01-intro.Rmd
会报错
Error in penguins %>% head(4) %>% knitr::kable(caption = "Here is a nice table!", : û��"%>%"������� Calls: local ... handle -> withCallingHandlers -> withVisible -> eval -> eval
如果,在01-intro.Rmd 写全却可以