-
Notifications
You must be signed in to change notification settings - Fork 1
/
.Rhistory
512 lines (512 loc) · 21.6 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
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
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
read.csv("../immunology-bootcamp-2023/session-materials/session2/data/rnaseq.csv")
rna <- read.csv("../immunology-bootcamp-2023/session-materials/session2/data/rnaseq.csv")
View(rna)
select(rna, gene, sample, tissue, expression)
```{r}
library(tidyverse)
library(modelr)
options(na.action = na.warn)
library(nycflights13)
library(lubridate)
ggplot(diamonds, aes(cut, price)) + geom_boxplot()
ggplot(diamonds, aes(color, price)) + geom_boxplot()
ggplot(diamonds, aes(clarity, price)) + geom_boxplot()
quarto::quarto_render(output_format = "all")
install.packages(c("askpass", "bslib", "cpp11", "credentials", "curl", "cyclocomp", "dplyr", "dqrng", "fontawesome", "fs", "gert", "ggplot2", "gifski", "gtable", "htmltools", "httr", "igraph", "KernSmooth", "labeling", "languageserver", "lintr", "magick", "markdown", "Matrix", "mgcv", "nlme", "openssl", "packrat", "patchwork", "progressr", "promises", "purrr", "RcppArmadillo", "rematch", "remotes", "renv", "reticulate", "rmarkdown", "rsconnect", "sass", "shiny", "spatial", "spatstat.explore", "spatstat.geom", "styler", "survival", "targets", "tikzDevice", "tinytex", "uuid", "xfun"))
install.packages(c("askpass", "bslib", "cpp11", "credentials", "curl", "cyclocomp", "dplyr", "dqrng", "fontawesome", "fs", "gert", "ggplot2", "gifski", "gtable", "htmltools", "httr", "igraph", "KernSmooth", "labeling", "languageserver", "lintr", "magick", "markdown", "Matrix", "mgcv", "nlme", "openssl", "packrat", "patchwork", "progressr", "promises", "purrr", "RcppArmadillo", "rematch", "remotes", "renv", "reticulate", "rmarkdown", "rsconnect", "sass", "shiny", "spatial", "spatstat.explore", "spatstat.geom", "styler", "survival", "targets", "tikzDevice", "tinytex", "uuid", "xfun"))
install.packages(c("askpass", "bslib", "cpp11", "credentials", "curl", "cyclocomp", "dplyr", "dqrng", "fontawesome", "fs", "gert", "ggplot2", "gifski", "gtable", "htmltools", "httr", "igraph", "KernSmooth", "labeling", "languageserver", "lintr", "magick", "markdown", "Matrix", "mgcv", "nlme", "openssl", "packrat", "patchwork", "progressr", "promises", "purrr", "RcppArmadillo", "rematch", "remotes", "renv", "reticulate", "rmarkdown", "rsconnect", "sass", "shiny", "spatial", "spatstat.explore", "spatstat.geom", "styler", "survival", "targets", "tikzDevice", "tinytex", "uuid", "xfun"))
install.packages(c("askpass", "bslib", "cpp11", "credentials", "curl", "cyclocomp", "dplyr", "dqrng", "fontawesome", "fs", "gert", "ggplot2", "gifski", "gtable", "htmltools", "httr", "igraph", "KernSmooth", "labeling", "languageserver", "lintr", "magick", "markdown", "Matrix", "mgcv", "nlme", "openssl", "packrat", "patchwork", "progressr", "promises", "purrr", "RcppArmadillo", "rematch", "remotes", "renv", "reticulate", "rmarkdown", "rsconnect", "sass", "shiny", "spatial", "spatstat.explore", "spatstat.geom", "styler", "survival", "targets", "tikzDevice", "tinytex", "uuid", "xfun"))
install.packages(c("askpass", "bslib", "cpp11", "credentials", "curl", "cyclocomp", "dplyr", "dqrng", "fontawesome", "fs", "gert", "ggplot2", "gifski", "gtable", "htmltools", "httr", "igraph", "KernSmooth", "labeling", "languageserver", "lintr", "magick", "markdown", "Matrix", "mgcv", "nlme", "openssl", "packrat", "patchwork", "progressr", "promises", "purrr", "RcppArmadillo", "rematch", "remotes", "renv", "reticulate", "rmarkdown", "rsconnect", "sass", "shiny", "spatial", "spatstat.explore", "spatstat.geom", "styler", "survival", "targets", "tikzDevice", "tinytex", "uuid", "xfun"))
install.packages(c("askpass", "bslib", "cpp11", "credentials", "curl", "cyclocomp", "dplyr", "dqrng", "fontawesome", "fs", "gert", "ggplot2", "gifski", "gtable", "htmltools", "httr", "igraph", "KernSmooth", "labeling", "languageserver", "lintr", "magick", "markdown", "Matrix", "mgcv", "nlme", "openssl", "packrat", "patchwork", "progressr", "promises", "purrr", "RcppArmadillo", "rematch", "remotes", "renv", "reticulate", "rmarkdown", "rsconnect", "sass", "shiny", "spatial", "spatstat.explore", "spatstat.geom", "styler", "survival", "targets", "tikzDevice", "tinytex", "uuid", "xfun"))
install.packages(c("askpass", "bslib", "cpp11", "credentials", "curl", "cyclocomp", "dplyr", "dqrng", "fontawesome", "fs", "gert", "ggplot2", "gifski", "gtable", "htmltools", "httr", "igraph", "KernSmooth", "labeling", "languageserver", "lintr", "magick", "markdown", "Matrix", "mgcv", "nlme", "openssl", "packrat", "patchwork", "progressr", "promises", "purrr", "RcppArmadillo", "rematch", "remotes", "renv", "reticulate", "rmarkdown", "rsconnect", "sass", "shiny", "spatial", "spatstat.explore", "spatstat.geom", "styler", "survival", "targets", "tikzDevice", "tinytex", "uuid", "xfun"))
install.packages(c("askpass", "bslib", "cpp11", "credentials", "curl", "cyclocomp", "dplyr", "dqrng", "fontawesome", "fs", "gert", "ggplot2", "gifski", "gtable", "htmltools", "httr", "igraph", "KernSmooth", "labeling", "languageserver", "lintr", "magick", "markdown", "Matrix", "mgcv", "nlme", "openssl", "packrat", "patchwork", "progressr", "promises", "purrr", "RcppArmadillo", "rematch", "remotes", "renv", "reticulate", "rmarkdown", "rsconnect", "sass", "shiny", "spatial", "spatstat.explore", "spatstat.geom", "styler", "survival", "targets", "tikzDevice", "tinytex", "uuid", "xfun"))
quarto::quarto_render(output_format = "all")
quarto::quarto_render(output_format = "all")
norm_random1 <- rnorm(100, mean = 4, sd =1.5)
norm_random2 <- rnorm(100, mean = 3.5, sd =2)
hist(norm_random2)
hist(norm_random1)
norm_random2
t.test(norm_random1,norm_random2)
read.csv("session-materials/session2/data/rnaseq.csv")
rna <- read_csv("session-materials/session2/data/rnaseq.csv")
library(tidyverse)
rna <- read_csv("session-materials/session2/data/rnaseq.csv")
rna %>%
group_by(gene)
rna %>% mutate(time_hours = time * 24)
rana_with_time <- rna %>% mutate(time_hours = time * 24)
View(rana_with_time)
rna %>% mutate(time_hours = time * 24) %>% select(time, time_hours)
rna |> mutate(time_hours = time * 24|> select(time, time_hours)
rna |> mutate(time_hours = time * 24 |> select(time, time_hours)
rna |> mutate(time_hours = time * 24) |> select(time, time_hours)
rna |> mutate(time_hours = time * 24, time_mn = time_hours * 60) |> select(time, time_hours, time_mn)
View(rna)
View(rna)
new_rna_df <- rna |> select(gene, chromosome_name, phenotype_description, sample, expression) |>
mutate(expression_log = log(expression))
View(new_rna_df)
new_rna_df <- rna |> select(gene, chromosome_name, phenotype_description, sample, expression) |>
mutate(expression_log = log(expression)) |>
filter(chromosome_name == "X" | chromosome_name == "Y")
View(new_rna_df)
View(new_rna_df)
new_rna_df <- rna |> select(gene, chromosome_name, phenotype_description, sample, expression) |>
mutate(expression_log = log(expression)) |>
filter(chromosome_name == "X" | chromosome_name == "Y") |>
filter(!is.na(phenotype_description)) |>
filter(expression > 5)
View(new_rna_df)
View(rna)
rna |> group_by(gene)
rna |> group_by(sample)
rna |> group_by(gene) |> summarise(mean_expression = mean(expression))
rna |> group_by(sample) |> summarise(mean_expression = mean(expression))
rna |> group_by(sample) |> mutate(mean_expression = summarise(mean_expression = mean(expression))
)
summarise(mean_expression = mean(expression))
rna |> group_by(gene) |> summarise(mean_expression = mean(expression))
rna |> group_by(sample) |> mutate(mean_expression = mean(expression))
test_rna |> group_by(sample) |> mutate(mean_expression = mean(expression))
test_rna <- rna |> group_by(sample) |> mutate(mean_expression = mean(expression))
View(test_rna)
View(rana_with_time)
View(test_rna)
rna |> group_by(gene, infection, time)
rna |> group_by(gene, infection, time) |> summarise(mean_expression = mean(expression))
rna |> group_by(gene, infection, time)
rna |> group_by(gene, infection, time) |> summarise(mean_expression = mean(expression))
rna |> filter(gene == "Dok3") |> group_by(time) |> summarise(mean= mean(expression))
View(rna)
rna |> filter(sample == "GSM2545336") |> group_by(sample) |> summarise(mean= mean(expression))
rna |> filter(gene == "Dok3") |> group_by(time) |> summarise(mean= mean(expression))
View(rna)
rna |> count(infection)
rna |> group_by(infection) |> summarise(n=n())
rna |> count(infection, time)
View(rna)
View(rna)
rna |> count(sample)
rna |> count(sample) |> summarise(seq_depth = sum(expression))
rna |> count(sample) |> summarise(seq_depth = sum(expression))
rna |> group_by(sample) |> count(sample) |> summarise(seq_depth = sum(expression))
rna |> group_by(sample) |> summarise(seq_depth = sum(expression))
rna |> group_by(sample) |> summarise(seq_depth = sum(expression)) |> arrange(desc(seq_depth))
View(rna)
rna |> filter(sample == "GSM2543336")
rna |> filter(sample == "GSM2543336") |> group_by(gene_biotype) |> count(gene_biotype)
rna |> filter(sample == "GSM2545336") |> group_by(gene_biotype) |> count(gene_biotype)
rna |> filter(sample == "GSM2545336") |> group_by(gene_biotype) |> count(gene_biotype) |> arrange(desc(n))
View(rna)
rna |> arrange(gene)
rna_exp <- rna |> select(gene, sample, expression)
rna_exp
rna_exp |> pivot_wider(names_from = sample, values_from = expression)
View(rna_exp)
rna_exp <- rna_exp |> pivot_wider(names_from = sample, values_from = expression)
View(rna_exp)
rna_exp_wide <- rna_exp |> pivot_longer(names_to = sample, values_to = expression)
rna_exp_wide <- rna_exp |> pivot_longer(names_to = sample, values_to = expression, -gene)
rna_exp <- rna |> select(gene, sample, expression)
rna_exp_wide <- rna_exp |> pivot_wider(names_from = sample, values_from = expression)
rna_exp_wide <- rna_exp |> pivot_longer(names_to = sample, values_to = expression, -gene)
rna_exp_wide <- rna_exp_wide |> pivot_longer(names_to = sample, values_to = expression, -gene)
rna_exp_longer <- rna_exp_wide |> pivot_longer(names_to = sample, values_to = expression, -gene)
rna_exp <- rna |> select(gene, sample, expression)
View(rna_exp)
rna_exp_wide <- rna_exp |> pivot_wider(names_from = sample, values_from = expression)
View(rna_exp_wide)
rna_exp_longer <- rna_exp_wide |> pivot_longer(names_to = sample, values_to = expression, -gene)
rna_exp_longer <- rna_exp_wide |> pivot_longer(names_to = "sample", values_to = "expression", -gene)
View(rna_exp)
load("session-materials/session3/data/new_metadata.RData")
library(ggplot2)
library(tidyverse)
# this data frame should have 12 rows and 5 columns
View(new_metadata)
library(ggplot2)
ggplot(new_metadata)
ggplot(new_metadata) + geom_point()
ggplot(new_metadata) + geom_point()
ggplot(new_metadata) +
geom_point(aes(x = age_in_days, y= samplemeans))
ggplot(new_metadata) +
geom_point(aes(x = age_in_days, y= samplemeans, color = genotype))
ggplot(new_metadata) +
geom_point(aes(x = age_in_days, y= samplemeans, color = genotype,
shape=celltype))
ggplot(new_metadata) +
geom_point(aes(x = age_in_days, y= samplemeans, color = genotype,
shape=celltype), size=2.25)
ggplot(new_metadata) +
geom_point(aes(x = age_in_days, y= samplemeans, color = genotype,
shape=celltype), size=2.25) + theme_bw()
ggplot(new_metadata) +
geom_point(aes(x = age_in_days, y= samplemeans, color = genotype,
shape=celltype), size=2.25) + theme_dark()
ggplot(new_metadata) +
geom_point(aes(x = age_in_days, y= samplemeans, color = genotype,
shape=celltype), size=2.25) + theme_gray()
ggplot(new_metadata) +
geom_point(aes(x = age_in_days, y= samplemeans, color = genotype,
shape=celltype), size=2.25) + theme_bw()
ggplot(new_metadata) +
geom_point(aes(x = age_in_days, y= samplemeans, color = genotype,
shape=celltype), size=2.25) +
theme_bw() +
theme(axis.title = element_text(size=rel(1.5)))
View(new_metadata)
View(new_metadata)
load("session-materials/session3/data/new_metadata.RData")
view(new_metadata)
View(new_metadata)
library(ggplot2)
ggplot(new_metadata)
View(new_metadata)
ggplot(new_metadata) + geom_point()
ggplot(new_metadata) + geom_point(aes(x= age_in_days,
y= samplemeans))
ggplot(new_metadata) + geom_point(aes(x= age_in_days,
y= samplemeans,
color = genotype))
p <- ggplot(new_metadata) + geom_point(aes(x= age_in_days,
y= samplemeans,
color = genotype))
p
p
ggplot(new_metadata) + geom_point(aes(x= age_in_days,
y= samplemeans,
color = genotype,
shape = celltype))
ggplot(new_metadata) + geom_point(aes(x= age_in_days,
y= samplemeans,
color = genotype,
shape = celltype),
size = 2.25)
ggplot(new_metadata) + geom_point(aes(x= age_in_days,
y= samplemeans,
color = genotype,
shape = celltype),
size = 4)
ggplot(new_metadata) + geom_point(aes(x= age_in_days,
y= samplemeans,
color = genotype,
shape = celltype),
size = 3)
ggplot(new_metadata) + geom_point(aes(x= age_in_days,
y= samplemeans,
color = genotype,
shape = celltype),
size = 3) + theme_bw()
ggplot(new_metadata) + geom_point(aes(x= age_in_days,
y= samplemeans,
color = genotype,
shape = celltype),
size = 3) + theme_dark()
ggplot(new_metadata) + geom_point(aes(x= age_in_days,
y= samplemeans,
color = genotype,
shape = celltype),
size = 3) + theme_bw()
ggplot(new_metadata) + geom_point(aes(x= age_in_days,
y= samplemeans,
color = genotype,
shape = celltype),
size = 3) + theme_bw() +
theme(axis.title = element_text(size=4))
ggplot(new_metadata) + geom_point(aes(x= age_in_days,
y= samplemeans,
color = genotype,
shape = celltype),
size = 3) + theme_bw() +
theme(axis.title = element_text(size=10))
ggplot(new_metadata) + geom_point(aes(x= age_in_days,
y= samplemeans,
color = genotype,
shape = celltype),
size = 3) + theme_bw() +
theme(axis.title = element_text(size=20))
ggplot(new_metadata) + geom_point(aes(x= age_in_days,
y= samplemeans,
color = genotype,
shape = celltype),
size = 3) + theme_bw() +
theme(axis.title = element_text(size=15))
ggplot(new_metadata) + geom_point(aes(x= age_in_days,
y= samplemeans,
color = genotype,
shape = celltype),
size = 3) + theme_bw() +
theme(axis.title = element_text(size=15)) + ggtitle("My test figure")
ggplot(new_metadata) + geom_point(aes(x= age_in_days,
y= samplemeans,
color = genotype,
shape = celltype),
size = 3) + theme_bw() +
theme(axis.title = element_text(size=15)) + ggtitle("My test figure") +
xlab("Age in Days") + ylab("Sample Means")
ggplot(new_metadata) + geom_point(aes(x= age_in_days,
y= samplemeans,
color = genotype,
shape = celltype),
size = 3) + theme_bw() +
theme(axis.title = element_text(size=15)) + ggtitle("My test figure") +
xlab("Age in Days") + ylab("Sample Means") + theme(axis.title.x.top = "Age in Days")
ggplot(new_metadata) + geom_point(aes(x= age_in_days,
y= samplemeans,
color = genotype,
shape = celltype),
size = 3) + theme_bw() +
theme(axis.title = element_text(size=15)) + ggtitle("My test figure") +
xlab("Age in Days") + ylab("Sample Means") +
theme(axis.title.x.top = element_text()"Age in Days")
ggplot(new_metadata) + geom_point(aes(x= age_in_days,
y= samplemeans,
color = genotype,
shape = celltype),
size = 3) + theme_bw() +
theme(axis.title = element_text(size=15)) + ggtitle("My test figure") +
xlab("Age in Days") + ylab("Sample Means") +
theme(axis.title.x.top = element_text("Age in Days"))
ggplot(new_metadata) + geom_point(aes(x= age_in_days,
y= samplemeans,
color = genotype,
shape = celltype),
size = 3) + theme_bw() +
theme(axis.title = element_text(size=15)) + ggtitle("My test figure") +
xlab("Age in Days") + ylab("Sample Meantes") +
theme(axis.title.x.top = element_text("Text2"))
ggplot(new_metadata) + geom_point(aes(x= age_in_days,
y= samplemeans,
color = genotype,
shape = celltype),
size = 3) + theme_bw() +
theme(axis.title = element_text(size=15)) + ggtitle("My test figure") +
xlab("Age in Days") + ylab("Sample Means")
ggplot(new_metadata, aes(x = genotype, y= samplemeans, fill = celltype)) +
geom_boxplot()
library(ggplot2)
library(modelr)
library(tidyverse)
ggplot(sim1, aes(x, y)) +
geom_point()
a2 = runif(250, -5, 5)
ggplot(a2) + geom_histogram()
a2
models <- tibble(
a1 = runif(250, -20, 40),
a2 = runif(250, -5, 5)
)
View(models)
library(modelr)
options(na.action = na.warn)
library(nycflights13)
library(lubridate)
ggplot(diamonds, aes(cut, price)) + geom_boxplot()
ggplot(diamonds, aes(color, price)) + geom_boxplot()
ggplot(diamonds, aes(clarity, price)) + geom_boxplot()
ggplot(diamonds, aes(carat, price)) +
geom_hex(bins = 50)
diamonds2 <- diamonds %>%
filter(carat <= 2.5) %>%
mutate(lprice = log2(price), lcarat = log2(carat))
ggplot(diamonds2, aes(lcarat, lprice)) +
geom_hex(bins = 50)
diamonds2 <- diamonds %>%
filter(carat <= 2.5) %>%
mutate(lprice = log2(price), lcarat = log2(carat))
ggplot(diamonds, aes(carat, price)) +
geom_hex(bins = 50)
ggplot(diamonds2, aes(lcarat, lprice)) +
geom_hex(bins = 50)
mod_diamond <- lm(lprice ~ lcarat, data = diamonds2)
View(mod_diamond)
grid <- diamonds2 %>%
data_grid(carat = seq_range(carat, 20)) %>%
mutate(lcarat = log2(carat)) %>%
add_predictions(mod_diamond, "lprice") %>%
mutate(price = 2 ^ lprice)
View(grid)
View(diamonds2)
View(grid)
View(diamonds2)
View(mod_diamond)
ggplot(diamonds2, aes(carat, price)) +
geom_hex(bins = 50) +
geom_line(data = grid, colour = "red", size = 1)
diamonds2 <- diamonds2 %>%
add_residuals(mod_diamond, "lresid")
ggplot(diamonds2, aes(lcarat, lresid)) +
geom_hex(bins = 50)
ggplot(diamonds2, aes(cut, lresid)) + geom_boxplot()
install.packages("ggpubr")
female_weight <- c(38.9, 61.2, 73.3, 21.8, 63.4, 64.6, 48.4, 48.8, 48.5)
male_weight <- c(67.8, 60, 63.4, 76, 89.4, 73.3, 67.3, 61.3, 62.4)
# Create a data frame
my_data <- data.frame(
group = rep(c("Female", "Male"), each = 9),
weight = c(female_weight, male_weight)
)
# Print all data
print(my_data)
group_by(my_data, group) %>%
summarise(
count = n(),
mean = mean(weight, na.rm = TRUE),
sd = sd(weight, na.rm = TRUE)
)
View(my_data)
View(my_data)
ggplot(my_data, aes(x=group, y=weight)) + ggboxplot()
library(ggplot2)
ggplot(my_data, aes(x=group, y=weight)) + geom_boxplot()
ggplot(my_data, aes(x=group, y=weight)) + geom_boxplot(aes(color=group))
ggplot(my_data, aes(x=group, y=weight)) + geom_boxplot(aes(color=group), ylab = "Weight", xlab = "Groups")
ggplot(my_data, aes(x=group, y=weight), ylab = "Weight", xlab = "Groups") + geom_boxplot(aes(color=group))
quarto::quarto_render(output_format = "all")
quarto::quarto_render(output_format = "all")
quarto::quarto_render(output_format = "all")
quarto::quarto_render(output_format = "all")
install.packages("pasilla")
quarto::quarto_render(output_format = "all")
if (!require("BiocManager", quietly = TRUE))
install.packages("BiocManager")
BiocManager::install("pasilla")
quarto::quarto_render(output_format = "all")
library(pasilla)
BiocManager::install("pasilla")
library(pasilla)
quarto::quarto_render(output_format = "all")
quarto::quarto_render(output_format = "all")
quarto::quarto_render(output_format = "all")
sessionInfo()
female_weight <- c(38.9, 61.2, 73.3, 21.8, 63.4, 64.4, 48.4, 48.8, 48.5)
male_weight <- c(67.8, 60, 63.4, 76, 89.4, 73.3, 67.3, 61.3, 62.4)
my_data <- data.frame(group = rep(c("Female", "Male"), each = 9),
weight = c(female_weight, male_weight))
View(my_data)
print(my_data)
group_by(my_data, groups) |>
summarise(
count = n(),
mean = mean(weight),
sd = sd(weight)
)
library(tidyr)
group_by(my_data, groups) |>
summarise(
count = n(),
mean = mean(weight),
sd = sd(weight)
)
library(dplyr)
group_by(my_data, groups) |>
summarise(
count = n(),
mean = mean(weight),
sd = sd(weight)
)
group_by(my_data, group) |>
summarise(
count = n(),
mean = mean(weight),
sd = sd(weight)
)
library(tidyverse)
group_by(my_data, group) |>
summarise(
count = n(),
mean = mean(weight),
sd = sd(weight)
)
library(ggplot2)
ggplot(my_data, aes(x=group, y=weight)) + geom_boxplot()
ggplot(my_data, aes(x=group, y=weight)) + geom_boxplot(aes(color=group))
ggplot(my_data, aes(x=group, y=weight)) + geom_boxplot(aes(color=group)) + theme_bw()
with(my_data, shapiro.test(weight[group == "Male"]))
with(my_data, shapiro.test(weight[group == "Male"]))
with(my_data, shapiro.test(weight[group == "Female"]))
res.ftest <- var.test(weight ~ group, data = my_data)
res.ftest
t.test(female_weight, male_weight, var.equal = TRUE)
library(pasilla)
pasilla
# Print all data
print(my_data)
# Print all data
print(my_data)
library(ggplot2)
library(tidyverse)
ggplot(new_metadata) +
geom_point(aes(x = age_in_days, y= samplemeans, color = genotype,
shape=celltype))
ggplot(new_metadata) +
geom_point(aes(x = age_in_days, y= samplemeans, color = genotype,
shape=celltype), size=2.25)
ggplot(new_metadata) +
geom_point(aes(x = age_in_days, y= samplemeans, color = genotype,
shape=celltype))
ggplot(new_metadata) +
geom_point(aes(x = age_in_days, y= samplemeans, color = genotype,
shape=celltype), size=2.25)
install.packages("ggplot2")
install.packages("ggplot2")
View(new_metadata)
ggplot(new_metadata)
ggplot(new_metadata) +
geom_point(aes(x = age_in_days, y= samplemeans, color = genotype,
shape=celltype))
quarto::quarto_render(output_format = "all")
install.packages("airway")
library("DESeq2")
library(airway)
data(airway)
BiocManager::install("airway")
library("airway")
quarto::quarto_render(output_format = "all")
library(airway)
data(airway)
se <- airway
rowRanges(se)
colData(se)
dds <- DESeq(dds)
dds <- DESeqDataSet(se, design = ~ cell + dex)
dds
keep <- rowSums(counts(dds)) >= 4
table(keep)
dds <- dds[keep,]
dds <- DESeq(dds)
res <- results(dds)
res
View(p)
View(se)
View(dds)
View(se)
View(airway)
colData(se)
dds <- DESeqDataSet(se, design = ~ cell + dex)
quarto::quarto_render(output_format = "all")
colData(se)
se
dds <- DESeqDataSet("../session5/data/airway_colData.csv", design = ~ cell + dex)
DESeqDataSet(se, design = ~ cell + dex)
dds <- DESeqDataSet(se, design = ~ cell + dex)
dds
quarto::quarto_render(output_format = "all")
#| echo: false
#| message: false
library(tidyverse)
library(reactable)
library(reactablefmtr)
#Load schedule
sched <- read_csv("schedule.csv")
reactable(select(sched, `Session`, `Date`, `Time`), theme = flatly(), sortable = FALSE)
quarto::quarto_render(output_format = "all")
quarto::quarto_render(output_format = "all")
quarto::quarto_render(output_format = "all")
quarto::quarto_render(output_format = "all")
quarto::quarto_render(output_format = "all")
quarto::quarto_render(output_format = "all")
quarto::quarto_render(output_format = "all")
quarto::quarto_render(output_format = "all")