-
Notifications
You must be signed in to change notification settings - Fork 2
/
.Rhistory
38 lines (38 loc) · 1.34 KB
/
.Rhistory
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
library("ggplot2", lib.loc="/Library/Frameworks/R.framework/Versions/3.3/Resources/library")
library(ggplot2)
data(diamonds)
head(diamonds)
summary(diamonds)
ggplot(aes(x = log(price)), data = diamonds) +
geom_histogram(aes(fill = cut)) +
facet_wrap(~color) +
scale_fill_brewer(type = 'qual')
ggplot(aes(x = log(price)), data = diamonds) +
geom_line(aes(color = cut)) +
scale_color_brewer(type = 'qual')
ggplot(aes(x = log(price)), data = diamonds) +
geom_histogram(aes(color = cut)) +
scale_color_brewer(type = 'qual')
head(diamonds)
ggplot(aes(x = log(price), y = table), data = diamonds) +
geom_histogram(aes(color = cut)) +
scale_color_brewer(type = 'qual')
ggplot(aes(x = log(price), y = table), data = diamonds) +
geom_line(aes(color = cut)) +
scale_color_brewer(type = 'qual')
ggplot(aes(x = table, y = price), data = diamonds) +
geom_line(aes(color = cut)) +
scale_color_brewer(type = 'qual')
ggplot(aes(x = table, y = price), data = diamonds) +
geom_point(aes(color = cut)) +
scale_color_brewer(type = 'qual')
diamonds$volume = diamonds$x * diamonds$y * diamonds$z
ggplot(aes(x = volume, y = price), data = diamonds) +
geom_point(aes(color = clarity)) +
ylim(0, quantile(diamonds$volume, 0.99)) +
scale_y_log10() +
coord_cartesian(xlim = c(0,350))
pf <- read.csv('pseudo_facebook.tsv')
pf$prop_initiated <- pf$friendships_initiated/pf$friend_count
head(pf)
head(pf)