Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

R markdown, hiding the library output

I am working on a rmarkdown presentation. I am trying to show the usage of cast function. However, since the reshape package is necessary, to run the cast function, I need to load reshape library as below.

{r package_options, echo=TRUE}
library(reshape)
cast(datam, isim~Ay, value="Sirano")

However, after knitting the codes, I face with the output ; enter image description here

I just need to see the name of the library on the screen which is library(reshape) , and also I want it to be used to run cast function, but I dont want to see the package outputs as shown in the picture.

Would someone help about that?

like image 266
maydin Avatar asked Jun 13 '17 11:06

maydin


People also ask

How do I hide the output in R Markdown?

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?

Hide source code: ```{r, echo=FALSE} 1 + 1 ``` Hide text output (you can also use `results = FALSE`): ```{r, results='hide'} print("You will not see the text output.") ``` Hide messages: ```{r, message=FALSE} message("You will not see the message.") ``` Hide warning messages: ```{r, warning=FALSE} # this will generate ...

How do I show output in R Markdown?

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

If you want to hide all these messages you have to put :

```{r,warning=FALSE,message=FALSE}
library(reshape)
```
like image 151
Arault Avatar answered Oct 03 '22 08:10

Arault