Forums | OpenR

OpenR: R & Statistics /
Question about chunk code result hiding


Lingxiao Xu's profile picture
Posts: 4

24 March 2022, 7:05 PM

Hello teacher, I recently used library() to install the package needed to use the %>% symbol for arithmetic when I wrote my essay using rmd, but the code output from the library() package installation I didn't want it to appear in my essay as redundant, so I used message= FAlSE to hide the result, but after hiding it, %>% symbol is not available again, how should I solve this problem or not use the hide function?

Peng Zhao's profile picture
Posts: 128

25 March 2022, 1:55 PM

Short answer: Instead of %>%, you can use the built-in pipe operator |>, which does not require any package to load.

Long answer:

I do not see anything relevant to message= FALSE in your case. You could post here the text in your Rmd file and let me have a look.

|> can replace %>% in most cases, and faster. If you insist on using %>%, you could load the package in your Rmd file like this:

```{r, echo = FALSE}
library(magrittr)
```

 

Lingxiao Xu's profile picture
Posts: 4

25 March 2022, 2:15 PM

I tried replacing the pipe symbol with |> and the problem was solved, thanks for your careful answer!

3 results