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 ;
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?
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.
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 ...
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 .
If you want to hide all these messages you have to put :
```{r,warning=FALSE,message=FALSE}
library(reshape)
```
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With