无声的StMoMo包消息

时间:2015-09-03 08:28:02

标签: r knitr r-markdown

我使用StMoMo来拟合死亡率模型。目前我正在研究RStudio中的ioslies演示。但是,我无法对包裹消息进行静音。

这是我的大块:

```{r, verbose=FALSE, warning=FALSE, message=FALSE}
library(StMoMo)
Dxt <- EWMaleData$Dxt
Ext <- EWMaleData$Ext + 0.5 * EWMaleData$Dxt
ages <- EWMaleData$ages
years <- EWMaleData$years
ages.fit <- 55:89
wxt <- genWeightMat(ages = ages.fit, years = years, clip = 3)
LCfit <- fit(LC, Dxt = Dxt, Ext = Ext, ages = ages, years = years,
ages.fit = ages.fit, wxt = wxt)
```

但是我仍然在knitr HTML输出中得到以下信息:

## StMoMo: The following cohorts have been zero weigthed: 1872 1873 1874     1954 1955 1956
## StMoMo: Start fitting with gnm
## Initialising
## Running start-up iterations..
## Running main iterations.....
## Done
## StMoMo: Finish fitting with gnm

任何想法如何摆脱这些信息,但仍然评估代码?

1 个答案:

答案 0 :(得分:1)

只需将verbose = FALSE函数中的参数fit添加到无声StMoMo,即

LCfit <- fit(LC, Dxt = Dxt, Ext = Ext, ages = ages, years = years, 
         ages.fit =   ages.fit, wxt = wxt, verbose = FALSE)