How do I suppress this output?

前端 未结 1 1176
青春惊慌失措
青春惊慌失措 2021-01-18 07:54

I have a code chunk in an R Markdown file.

```{r}
library(UsingR)
```

Using knitHTML to compile causes the following output, which never ha

1条回答
  •  清歌不尽
    2021-01-18 08:22

    Setting message=FALSE in your code chunk should work.

    ```{r, message=FALSE}
    library(UsingR)
    ```
    

    Setting echo=FALSE should not have worked - this is by design. The echo parameter in the code chunk controls the display of the code inside the chunk (i.e. library(UsingR)).

    Messages (as shown) are handled separately through the message parameter.

    Errors are handled through the error parameter (i.e. error=FALSE will suppress error messages).

    Results are handled through the results parameter (i.e. results=FALSE will suppress the results of the code chunk).

    Warnings are handled through the warning parameter (i.e. warning=FALSE will suppress the warnings generated by the code chunk) as warnings are distinct from errors.

    There are many other code-chunk parameters available, but these are the main parameters governing the text-based output generated by a given code-chunk.

    0 讨论(0)
提交回复
热议问题