Suppress running messages from RStan in Rmarkdown HTML output

时光怂恿深爱的人放手 提交于 2019-12-23 07:47:16

问题


The following are my r code.

```{r message=FALSE, warning=FALSE, cache=0,eval=TRUE, error=FALSE}
stan_m1 <- rethinking::map2stan(
  alist(
    y ~ dbinom(n, p),
    logit(p) <- alpha + bP*P + bA*A + bV*V,
    alpha ~ dnorm(0, 10),
    bP ~ dnorm(0, 5),
    bA ~ dnorm(0, 5),
    bV ~ dnorm(0, 5)
  ),
  data = d1, chains=2 , iter=2500 , warmup=500, debug=FALSE , 
  verbose=FALSE,refresh=-1
)

When I knit my rmarkdown file as html output, I am getting following output. Is there any way to turn off these messages?


回答1:


Put results="hide" in your chunk header.

And, in rstan 2.18.2 or later you can specify the refresh = 0 argument to accomplish the same thing.



来源:https://stackoverflow.com/questions/47104377/suppress-running-messages-from-rstan-in-rmarkdown-html-output

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!