You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This demo shows you how to merge the source and output blocks in markdown output. Note **knitr** puts R source and output in separate blocks by default.
```{r setup}
# first ``` are the end of previous source block; second ``` are the beginning
# of next output block
knit_hooks$set(chunk = function(x, options) {
gsub('```\n+```', '', x)
})
```
See if it works:
```{r test}
a = 1
a
```
Source and output lived together happily ever in **knitr**.