Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Suppress running messages from RStan in Rmarkdown HTML output

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?

R-Output

like image 819
score324 Avatar asked Nov 03 '17 21:11

score324


People also ask

How do you hide RMD output?

You use results="hide" to hide the results/output (but here the code would still be displayed). You use include=FALSE to have the chunk evaluated, but neither the code nor its output displayed.

How do I hide code but show output in R markdown?

include = FALSE prevents code and results from appearing in the finished file. R Markdown still runs the code in the chunk, and the results can be used by other chunks. echo = FALSE prevents code, but not the results from appearing in the finished file. This is a useful way to embed figures.

How do I show output in Rmarkdown?

If you prefer to use the console by default for all your R Markdown documents (restoring the behavior in previous versions of RStudio), you can make Chunk Output in Console the default: Tools -> Options -> R Markdown -> Show output inline for all R Markdown documents .


1 Answers

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.

like image 103
Ben Goodrich Avatar answered Sep 25 '22 07:09

Ben Goodrich