Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/r/64.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
R 如何在bookdown中使用新的bs4()主题?_R_R Markdown_Bookdown - Fatal编程技术网

R 如何在bookdown中使用新的bs4()主题?

R 如何在bookdown中使用新的bs4()主题?,r,r-markdown,bookdown,R,R Markdown,Bookdown,如何在bookdown中使用bs4主题,例如用于 在\u output.yaml中,我看到了以下代码,但它不适用于我的项目 bookdown::bs4_book: theme: primary: "#637238" repo: https://github.com/hadley/r4ds includes: in_header: [ga_script.html] 当我试图建立这本书时,我得到了这个错误 Error: 'bs4_book' is n

如何在bookdown中使用
bs4
主题,例如用于

\u output.yaml
中,我看到了以下代码,但它不适用于我的项目

bookdown::bs4_book:
  theme:
    primary: "#637238"
  repo: https://github.com/hadley/r4ds
  includes:
    in_header: [ga_script.html]
当我试图建立这本书时,我得到了这个错误

Error: 'bs4_book' is not an exported object from 'namespace:bookdown'
Execution halted

我通过以下操作使其工作:

bookdown::bs4_book:
  theme:
    primary: "#637238"
运行以下命令

remotes::install_github("rstudio/bslib")
install.packages("downlit")
remotes::install_github("rstudio/bookdown")
\u output.yaml
更改为以下内容:

bookdown::bs4_book:
  theme:
    primary: "#637238"

通过从github repo安装开发版本:您是否安装了包含书籍格式代码的
R4DS
包?您可以通过
devtools::install\u github(“hadley/r4ds”)
@DirkEddelbuettel安装它,谢谢
bookdown
对于构建文档,
bslib
对于
bookdown::bs4\u book
本身和
downlit
由于
错误:必须安装以下软件包才能使用bs4\u book()*downlit
。我认为下面这行就足够了,
devtools::install\u github('rstudio/bookdown@bs4-书本编码',force=TRUE)