Use the chunk option fig.keep="none". For example, this chunk will assign the a variable, run the plotting code, but then not include the plot in the rendered document.
```{r pressure, fig.keep='none'}
a <- 1
plot(pressure)
```
There are a lot of chunk options. You can look through them on knitr's documentation site.