R Markdown provides an authoring framework for data science. You can use a single R Markdown file to both
R Markdown documents are fully reproducible and support dozens of static and dynamic output formats. This 1-minute video provides a quick tour of what’s possible with R Markdown:
Like the rest of R, R Markdown is free and open source. You can install the R Markdown package from CRAN with:
install.packages("rmarkdown")
Code below demonstrates to color palettes in the viridis package. Each plot displays a contour map of the Maunga Whau volcano in Auckland, New Zealand.
ls *.Rmd
Below packages are for tables
It is also very easy to make tables with knitr’s kable function:
Note the use of the results=‘asis’ chunk option. This is required to ensure that the raw table output isn’t processed further by knitr.
| mpg | cyl | disp | hp | drat | wt | qsec | vs | am | gear | carb | |
|---|---|---|---|---|---|---|---|---|---|---|---|
| Mazda RX4 | 21.0 | 6 | 160 | 110 | 3.90 | 2.620 | 16.46 | 0 | 1 | 4 | 4 |
| Mazda RX4 Wag | 21.0 | 6 | 160 | 110 | 3.90 | 2.875 | 17.02 | 0 | 1 | 4 | 4 |
| Datsun 710 | 22.8 | 4 | 108 | 93 | 3.85 | 2.320 | 18.61 | 1 | 1 | 4 | 1 |
| Hornet 4 Drive | 21.4 | 6 | 258 | 110 | 3.08 | 3.215 | 19.44 | 1 | 0 | 3 | 1 |
| Hornet Sportabout | 18.7 | 8 | 360 | 175 | 3.15 | 3.440 | 17.02 | 0 | 0 | 3 | 2 |
You can use Pandoc’s Markdown to make:
I like several of their flavors of ice cream: #22, for example, and #5.
{#identifier .class .class key=value key=value}
Dogs?–in my house?
one
two
three
one
two
three
here is my first list item.
and my second.
here is my first list item.
and my second.
First paragraph.
Continued.
Second paragraph. With a code block, which must be indented eight spaces:
{ code }
fruits
vegetables
A lazy, lazy, list item.
Another one; this looks bad but is legal.
Second paragraph of second list item.
and this one:
: Definition 1
Definition 2
{ some code, part of Definition 2 }
Third paragraph of definition 2.
This is an inline link, and here’s one with a title.
See the Introduction.