-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathggplot.R
63 lines (48 loc) · 1.13 KB
/
ggplot.R
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
## https://www.youtube.com/watch?v=HPJn1CMvtmI
library(tidyverse)
BOD # native R data
ggplot(data = BOD,
mapping = aes(x = Time,
y = demand)
)+
geom_point(size = 5) +
geom_line(color = "red")
####
ggplot(BOD, aes(Time, demand))+
geom_point(size = 5)+
geom_line(color = "red")
####
CO2 %>%
ggplot(aes(conc, uptake,
color = Treatment))+
geom_point(size = 3, alpha = 0.5)+
geom_smooth(method = lm, se =F)+
facet_wrap(~Type)+
labs(title = "Ceoncentration of CO2")+
theme_bw()
####
CO2 %>%
ggplot(aes(Treatment, uptake))+
geom_boxplot()+
geom_point(alpha=.25)+
theme_bw()
CO2 %>%
ggplot(aes(Treatment, uptake))+
geom_boxplot()+
geom_point(aes(size = conc,
color = Plant),
alpha = 0.5)+
facet_wrap(~Type)+
coord_flip()+
theme_bw()
####
mpg %>%
filter(cty < 25) %>%
ggplot(aes(displ,cty))+
geom_point(aes(color = drv,
size = trans),
alpha = 0.5)+
geom_smooth(method = lm)+
facet_wrap(~year, nrow=1)+
labs(x = "Engine size", y= "MPG in the city", title = "Fuel efficieny")+
theme_bw()