【发布时间】:2018-08-01 00:55:52
【问题描述】:
我想编写带有 NMS 排序的报告。我想在报告中包含代码,但不是运行压力。
我已经尝试过message=FALSE, warning=FALSE, results='hide',但它仍然包含在报告中。
bc.nms <- metaMDS(as.dist(bc), k=2, trymin=50, trymax=500, wascores=F)
## Run 0 stress 0.2484634
## Run 1 stress 0.2548965
## Run 2 stress 0.2660619
## Run 3 stress 0.2471903
## ... New best solution
## ... Procrustes: rmse 0.07881697 max resid 0.198888
## Run 4 stress 0.2515325
## Run 5 stress 0.2456675
## ... New best solution
## ... Procrustes: rmse 0.04504745 max resid 0.2189408
## Run 6 stress 0.2563108
我只想要
bc.nms <- metaMDS(as.dist(bc), k=2, trymin=50, trymax=500, wascores=F)
如果它有助于弄清楚如何抑制不需要的结果,这是我的 knitr 选项和我的报告的屏幕截图
output:
html_document:
toc: true # table of content true
depth: 3 # upto three depths of headings (specified by #, ## and ###)
self_contained: yes
更新。抱歉,应该包括使用纯素数据集。
install.packages("vegan")
library(vegan)
data(dune)
bc.nms <- metaMDS(dune, k=2, trymin=50, trymax=500)
vegan 中的解决方案比 capture.output 更直接(也有效)
bc.nms <- metaMDS(dune, k=2, trymin=50, trymax=500, trace=FALSE)
【问题讨论】: