You can remove the code by using the option "echo=FALSE" in the code chunks.
If you go into RStudio and create a new RMD document, the last example shows this.
```{r pressure, echo=FALSE}
plot(pressure)
```
You can also set this globally at the beginning by doing something like this
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = FALSE)
```