-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path02-01-2024-Notes.R
103 lines (86 loc) · 2.26 KB
/
02-01-2024-Notes.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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
#02/01/2024
#no attach
#what can I do with the space data??? What would be interesting to me???
library(tidyverse)
library(palmerpenguins)
names(penguins)
pengiuns<-penguins
penguins %>%
ggplot(mapping = aes(x=flipper_length_mm,
y=body_mass_g,
color=species))+
geom_point()+
stat_ellipse()+
scale_color_manual(values = c("darkorchid4",
"deeppink3",
"seagreen3"))
#install.packages("leaflet")
library(leaflet)
#eww
penguins %>%
ggplot(aes(x=year,
y= body_mass_g)) +
geom_boxplot()
#ewwww
penguins %>%
ggplot(aes(x=year,
y= body_mass_g)) +
geom_point()
penguins %>%
ggplot(aes(x=species,
y= body_mass_g)) +
geom_boxplot()+
geom_point()
penguins %>%
ggplot(aes(x=species,
y= body_mass_g)) +
geom_boxplot()+
geom_jitter()
penguins %>%
ggplot(aes(x=species,
y= body_mass_g)) +
geom_boxplot()+
geom_jitter(height=0,width=0.1, alpha=0.2)
penguins %>%
ggplot(aes(x=body_mass_g,fill=species))+
geom_density(alpha=0.25)
penguins %>%
ggplot(aes(x=body_mass_g,fill=species))+
geom_histogram(alpha=0.5)
#don't have data
#have a goal
#plot the data before doing stats
df<-read_delim("./Data/DatasaurusDozen.tsv")
df %>%
group_by(dataset) %>%
summarise(meanx=mean(x),
sdx=sd(x),
minx=min(x),
maxx=max(x),
medianx=median(x))
df %>%
ggplot(aes(x=x, fill=dataset))+
geom_density(alpha=0.3)
df %>%
ggplot(aes(x=x, y=y))+
geom_point(alpha=0.3)+
facet_wrap(~dataset) #need on test
#install.packages("GGally")
library(GGally)
GGally::
ggpairs(pengiuns)
names(penguins)
#body_mass_g and flipper_lenth
penguins %>%
ggplot(mapping=aes(x=bill_depth_mm, y=flipper_length_mm,color=sex))+
geom_point()+
scale_color_manual(values = c("darkorchid4",
"deeppink3"))
penguins %>%
ggplot(mapping=aes(x=bill_depth_mm, y=flipper_length_mm,color=island))+
geom_point(size=5,alpha=0.5)+
#stat_ellipse()+
facet_wrap(~species) +
scale_color_manual(values = c("darkorchid4",
"deeppink3",
"seagreen3")) #yay colors