【问题标题】:R Markdown: knitr option results='hide' not workingR Markdown:knitr选项结果='隐藏'不起作用
【发布时间】:2019-04-16 05:52:23
【问题描述】:

我正在尝试生成一个执行并显示代码但隐藏输出的块代码。我知道这样做的方法是在knitr 块选项中添加echo = T, results = 'hide',正如here 所建议的那样。但是,就我而言,这仍然会产生输出,有什么想法吗?

我的会话信息:

> sessionInfo()
R version 3.4.3 (2017-11-30)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows >= 8 x64 (build 9200)

Matrix products: default

locale:
[1] LC_COLLATE=English_United Kingdom.1252 
[2] LC_CTYPE=English_United Kingdom.1252   
[3] LC_MONETARY=English_United Kingdom.1252
[4] LC_NUMERIC=C                           
[5] LC_TIME=English_United Kingdom.1252    

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

loaded via a namespace (and not attached):
 [1] compiler_3.4.3  backports_1.1.2 rprojroot_1.3-2 htmltools_0.3.6
 [5] tools_3.4.3     yaml_2.2.0      Rcpp_0.12.19    rmarkdown_1.10 
 [9] knitr_1.20      digest_0.6.18   evaluate_0.12  

【问题讨论】:

  • results 控制文本输出,例如summary()print()

标签: r r-markdown knitr


【解决方案1】:

可以使用选项fig.keep = 'none' 抑制绘图。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-11-29
    • 1970-01-01
    • 2016-02-02
    • 1970-01-01
    相关资源
    最近更新 更多