print("hello, R users")
## [1] "hello, R users"
print("hello, world")
## [1] "hello, world"
a <- c(1, 2, 3)
a + 1
## [1] 2 3 4
library(ggplot2)
ggplot(data = mpg, mapping = aes(x = displ, y = hwy)) + geom_point(aes(color = drv))
1 + 1
## [1] 2
To implement the tabbed section in an Rmarkdown document like the example above, all you have to do is putting {.tabset} on the right of a header. Then all the content below each sub-header will appear within a tab. Besides, this feature is only avaliable when rendering an Rmarkdown file to an html file.
You can also read the section 3.1.3 of R Markdown: The Definitive Guide for more details.