Exercice 1:
Créez une nouvelle colonne (blade.ratio) avec le ratio de
blade.length.mm
ettotal.leaf.length.mm
mutate(expt1, blade.ratio=blade.length.mm/total.leaf.length.mm)
## # A tibble: 957 x 16
## plant_nb genotype background temperature fluctuation day.length vernalization
## <dbl> <chr> <chr> <dbl> <chr> <dbl> <chr>
## 1 1 Col Ama Col 12 Con 16 NV
## 2 2 Col Ama Col 12 Con 16 NV
## 3 3 Col Ama Col 12 Con 16 NV
## 4 4 Col Ama Col 12 Con 16 NV
## 5 5 Col Ama Col 12 Con 16 NV
## 6 6 Col Ama Col 12 Con 16 NV
## 7 7 Col Ama Col 12 Con 16 NV
## 8 8 Col Ama Col 12 Con 16 NV
## 9 1 Col Ama Col 12 Con 8 NV
## 10 2 Col Ama Col 12 Con 8 NV
## # … with 947 more rows, and 9 more variables: survival.bolt <chr>, bolt <chr>,
## # days.to.bolt <dbl>, days.to.flower <dbl>, rosette.leaf.num <dbl>,
## # cauline.leaf.num <dbl>, blade.length.mm <dbl>, total.leaf.length.mm <dbl>,
## # blade.ratio <dbl>
Exercice 2
Représenter des violin plots de
cauline.leaf.num
pour les génotypes debackground
“Col”, colorés par la température et ce uniquement pour les plantes sans fluctuation de température et qui sont en jours longs (16 h).Ordonnez les génotypes selon ces deux cas (un graphique par cas):
-1 Dans l’ordre suivant: “Col Ama”, “ld-1”, “fve-3”, “flk-1”
-2 Dans l’ordre de la valeur de
cauline.leaf.num
# Ordonnez les génotypes dans l'ordre suivant: "Col Ama", "ld-1", "fve-3", "flk-1"
filter(expt1, background=="Col" & fluctuation=="Con" & day.length==16) %>%
mutate(genotype = factor(genotype, levels = c("Col Ama", "ld-1", "fve-3", "flk-1"))) %>%
ggplot(aes(x=genotype, y=cauline.leaf.num, fill=factor(temperature))) +
geom_violin()
## Warning: Removed 1 rows containing non-finite values (stat_ydensity).
# Ordonnez les génotypes dans l'ordre de la valeur de `cauline.leaf.num`
filter(expt1, background=="Col" & fluctuation=="Con" & day.length==16) %>%
mutate(genotype = fct_reorder(genotype, cauline.leaf.num)) %>%
ggplot(aes(x=genotype, y=cauline.leaf.num, fill=factor(temperature))) +
geom_violin()
## Warning: Removed 1 rows containing non-finite values (stat_ydensity).