- 鑽研資料科學的同好會
- Facebook 頁面
- Meetup 頁面
- Github 頁面

2015-07-15

圖片來源: http://myfootpath.com/careers/engineering-careers/statistician-careers/
取自http://www.r-bloggers.com/mapping-the-worlds-biggest-airlines/
取自 http://r4stats.com/2013/03/19/r-2012-growth-exceeds-sas-all-time-total/
來源:http://img.diynetwork.com/DIY/2003/09/18/t134_3ca_med.jpg
install.packages("rmarkdown")
$ equation $$$ equation $$rmarkdown::render("input.Rmd")
help (?)可以查閱Markdown語法R code will be evaluated and printed
```{r}
summary(cars$dist)
```
summary(cars$dist)
## Min. 1st Qu. Median Mean 3rd Qu. Max. ## 2.00 26.00 36.00 42.98 56.00 120.00
```{r plot}
summary(cars)
plot(cars)
```
Easy Navigation in RStudio
echo(TRUE): whether to include R source code in the output fileeval(TRUE): whether to evaluate the code chunkmessage(TRUE): whether to preserve messages emitted by message()include(TRUE): whether to be written into the output document, but the code is still evaluated and plot files are generatedwarning(TRUE): whether to preserve warnings in the outputcomment("##"): set to comment notationresults('hide','asis'): hide output ; asis treats the output of your R code as literal Markdown (when using like kable function)Set global chunk options at code chunks header:
knitr::opts_chunk$set(echo=FALSE, results='hide')
---
title: "Example 1"
output: html_document
---
Given Fisher’s iris data set and one simple command,
then we can produce this plot as following:
```{r}
library(ggplot2)
qplot(Sepal.Length, Petal.Length, data = iris, color = Species)
```
--- title: "Example 2" output: slidy_presentation --- ## Learn ggplot2 by example Try Fisher’s iris data set```{r} library(ggplot2) ggplot(data=iris, aes(x=Sepal.Length, y=Sepal.Width)) + geom_point() ```## Learn ggplot2 by example 2 Differentiate Species by color```{r} ggplot(data=iris, aes(x=Sepal.Length, y=Sepal.Width, color=Species)) + geom_point(size=3) ```
rmarkdown::render("test.R")
#' Density Curve of Sepal Width
library(ggplot2)
density2 <- ggplot(data=iris, aes(x=Sepal.Width, fill=Species))
density2 + geom_density(stat="density", alpha=I(0.2)) +
xlab("Sepal Width") + ylab("Density")