|
| 1 | +--- |
| 2 | +title: "Hello R Markdown" |
| 3 | +author: "Frida Gomam" |
| 4 | +date: 2015-07-23T21:13:14-05:00 |
| 5 | +categories: ["R"] |
| 6 | +tags: ["R Markdown", "plot", "regression"] |
| 7 | +--- |
| 8 | + |
| 9 | + |
| 10 | + |
| 11 | +<div id="r-markdown" class="section level1"> |
| 12 | +<h1>R Markdown</h1> |
| 13 | +<p>This is an R Markdown document. Markdown is a simple formatting syntax for authoring HTML, PDF, and MS Word documents. For more details on using R Markdown see <a href="http://rmarkdown.rstudio.com" class="uri">http://rmarkdown.rstudio.com</a>.</p> |
| 14 | +<p>You can embed an R code chunk like this:</p> |
| 15 | +<pre class="r"><code>summary(cars) |
| 16 | +## speed dist |
| 17 | +## Min. : 4.0 Min. : 2.00 |
| 18 | +## 1st Qu.:12.0 1st Qu.: 26.00 |
| 19 | +## Median :15.0 Median : 36.00 |
| 20 | +## Mean :15.4 Mean : 42.98 |
| 21 | +## 3rd Qu.:19.0 3rd Qu.: 56.00 |
| 22 | +## Max. :25.0 Max. :120.00 |
| 23 | +fit <- lm(dist ~ speed, data = cars) |
| 24 | +fit |
| 25 | +## |
| 26 | +## Call: |
| 27 | +## lm(formula = dist ~ speed, data = cars) |
| 28 | +## |
| 29 | +## Coefficients: |
| 30 | +## (Intercept) speed |
| 31 | +## -17.579 3.932</code></pre> |
| 32 | +</div> |
| 33 | +<div id="including-plots" class="section level1"> |
| 34 | +<h1>Including Plots</h1> |
| 35 | +<p>You can also embed plots. See Figure <a href="#fig:pie">1</a> for example:</p> |
| 36 | +<pre class="r"><code>par(mar = c(0, 1, 0, 1)) |
| 37 | +pie( |
| 38 | + c(280, 60, 20), |
| 39 | + c('Sky', 'Sunny side of pyramid', 'Shady side of pyramid'), |
| 40 | + col = c('#0292D8', '#F7EA39', '#C4B632'), |
| 41 | + init.angle = -50, border = NA |
| 42 | +)</code></pre> |
| 43 | +<div class="figure"><span id="fig:pie"></span> |
| 44 | +<img src="/post/2015-07-23-r-rmarkdown_files/figure-html/pie-1.png" alt="A fancy pie chart." width="672" /> |
| 45 | +<p class="caption"> |
| 46 | +Figure 1: A fancy pie chart. |
| 47 | +</p> |
| 48 | +</div> |
| 49 | +</div> |
0 commit comments