gpt4 book ai didi

r - 无法抑制 blogdown/knitr 中的消息

转载 作者:行者123 更新时间:2023-12-01 04:40:32 25 4
gpt4 key购买 nike

这是 blog使用 blogdown 创建的帖子

R 代码块以

```{r, echo = FALSE, message = FALSE, warning = FALSE}

但是,每次我使用 sf::st_read 读取 shapefile 时,都会出现三条消息。

如何防止这些消息出现在帖子中?

答案是否在 this关于 knitr 选项的页面?

最佳答案

将最初发布在评论中的明显解决方案移至完整答案。推理概述 in this meta discussion

I think st_read is just printing output normally, this won't be affected by message = FALSE or warning = FALSE. If you don't need any output from the chunk you can do results = 'hide' in the chunk options, otherwise I think you can stop it printing using st_read(..., quiet = TRUE)



原帖由 Marius 发表在 the comments

关于r - 无法抑制 blogdown/knitr 中的消息,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50479535/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com