-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathggplot_dataViz.R
27 lines (21 loc) · 992 Bytes
/
ggplot_dataViz.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
library(ggplot2)
library(palmerpenguins)
ggplot(data = diamonds) +
geom_bar(mapping = aes(x=cut, fill= cut))
ggplot(data = diamonds) +
geom_bar(mapping = aes(x=cut, fill= clarity))
ggplot(data = penguins) +
geom_point(mapping = aes(x = flipper_length_mm, y = body_mass_g,color = species)) +
facet_wrap(~species)
ggplot(data = penguins) +
geom_point(mapping = aes(x = flipper_length_mm, y = body_mass_g,color = species)) +
facet_grid(~species)
ggplot(data = diamonds) +
geom_bar(mapping = aes(x = color, fill = cut)) +
facet_wrap(~cut)
ggplot(data = penguins) +
geom_point(mapping = aes(x = flipper_length_mm, y = body_mass_g,color = species)) +
labs(title = "Palmer Penguins : Body Mas vsFlipper Lenght", subtitle = "Sample of the Three penguins species",
caption ="Data is collected by Dr.Kristen Gorman") +
annotate("text", x = 220,y = 3500, label = "The Gentoos are the largest", fontface = "bold",size = 4.5,angle = 28)
ggsave("Three Penguin Species.png")