-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathREADME.Rmd
80 lines (61 loc) · 1.77 KB
/
README.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
---
title: "R programming Week 9"
author: "Sungpil Han"
output:
github_document: default
---
2017년 1학기 강의용으로 만든 자료입니다.
```{r setup}
knitr::opts_chunk$set(error = TRUE, warning = FALSE)
Week09 <- c("tidyverse", "shiny", "dplyr", "ggplot2", "rmarkdown", "knitr", "flexdashboard", "ggsci") #install.packages(Week09)
LibraryWeek09 <- lapply(Week09, library, character.only = TRUE)
```
```{r}
#assign data to a variable
x <- c(77, 66, 88)
mean(x)
max(x)
#charts
plot(x)
barplot(x)
pie(x)
#' Plot navigation
#' export to the clipboard
#' Publish to http://rpubs.com/
# Demo: RStudio
#' - History
#' - Run from the beginneing
#' - Run to the end
#' - Plot
```
```{r eval = FALSE}
# Create Shiny Web App
shiny::runApp("Shiny")
shiny::runApp("pk_pd") # PMx_2016
```
```{r}
## Examples: ggplot2
library(ggplot2)
qplot(displ, hwy, data = mpg)
qplot(displ, hwy, data = mpg, color = drv)
qplot(displ, hwy, data = mpg, geom = c("point", "smooth"))
qplot(hwy, data = mpg, fill = drv)
qplot(displ, hwy, data = mpg, facets = . ~ drv)
qplot(hwy, data = mpg, facets = drv ~ ., binwidth = 2)
maacs <- read.csv("data-raw/maacs.csv", as.is = TRUE)
str(maacs)
# examples of qplot
qplot(log(eno), data = maacs)
qplot(log(eno), data = maacs, fill = mopos)
qplot(log(eno), data = maacs, geom = "density")
qplot(log(eno), data = maacs, geom = "density", color = mopos)
qplot(log(pm25), log(eno), data = maacs)
qplot(log(pm25), log(eno), data = maacs, shape = mopos)
qplot(log(pm25), log(eno), data = maacs, color = mopos)
qplot(log(pm25), log(eno), data = maacs, color = mopos, geom = c("point", "smooth"), method = "lm")
qplot(log(pm25), log(eno), data = maacs, geom = c("point", "smooth"), methods = "lm", facets = . ~ mopos)
```
# Session info
```{r}
devtools::session_info()
```