|
@@ -0,0 +1,49 @@
|
|
|
|
|
+---
|
|
|
|
|
+title: "Hello R Markdown"
|
|
|
|
|
+author: "Frida Gomam"
|
|
|
|
|
+date: 2015-07-23T21:13:14-05:00
|
|
|
|
|
+categories: ["R"]
|
|
|
|
|
+tags: ["R Markdown", "plot", "regression"]
|
|
|
|
|
+---
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+<div id="r-markdown" class="section level1">
|
|
|
|
|
+<h1>R Markdown</h1>
|
|
|
|
|
+<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>
|
|
|
|
|
+<p>You can embed an R code chunk like this:</p>
|
|
|
|
|
+<pre class="r"><code>summary(cars)
|
|
|
|
|
+## speed dist
|
|
|
|
|
+## Min. : 4.0 Min. : 2.00
|
|
|
|
|
+## 1st Qu.:12.0 1st Qu.: 26.00
|
|
|
|
|
+## Median :15.0 Median : 36.00
|
|
|
|
|
+## Mean :15.4 Mean : 42.98
|
|
|
|
|
+## 3rd Qu.:19.0 3rd Qu.: 56.00
|
|
|
|
|
+## Max. :25.0 Max. :120.00
|
|
|
|
|
+fit <- lm(dist ~ speed, data = cars)
|
|
|
|
|
+fit
|
|
|
|
|
+##
|
|
|
|
|
+## Call:
|
|
|
|
|
+## lm(formula = dist ~ speed, data = cars)
|
|
|
|
|
+##
|
|
|
|
|
+## Coefficients:
|
|
|
|
|
+## (Intercept) speed
|
|
|
|
|
+## -17.579 3.932</code></pre>
|
|
|
|
|
+</div>
|
|
|
|
|
+<div id="including-plots" class="section level1">
|
|
|
|
|
+<h1>Including Plots</h1>
|
|
|
|
|
+<p>You can also embed plots. See Figure <a href="#fig:pie">1</a> for example:</p>
|
|
|
|
|
+<pre class="r"><code>par(mar = c(0, 1, 0, 1))
|
|
|
|
|
+pie(
|
|
|
|
|
+ c(280, 60, 20),
|
|
|
|
|
+ c('Sky', 'Sunny side of pyramid', 'Shady side of pyramid'),
|
|
|
|
|
+ col = c('#0292D8', '#F7EA39', '#C4B632'),
|
|
|
|
|
+ init.angle = -50, border = NA
|
|
|
|
|
+)</code></pre>
|
|
|
|
|
+<div class="figure"><span id="fig:pie"></span>
|
|
|
|
|
+<img src="/post/2015-07-23-r-rmarkdown_files/figure-html/pie-1.png" alt="A fancy pie chart." width="672" />
|
|
|
|
|
+<p class="caption">
|
|
|
|
|
+Figure 1: A fancy pie chart.
|
|
|
|
|
+</p>
|
|
|
|
|
+</div>
|
|
|
|
|
+</div>
|