This is an R Markdown Notebook. When you execute code within the notebook, the results appear beneath the code.
Try executing this chunk by clicking the Run button within the chunk or by placing your cursor inside it and pressing Ctrl+Shift+Enter.
library(dplyr)
library(ggplot2)
library(tidyverse)
library(car)
library(RcmdrMisc)
library(colorspace, pos=17)
library(nlme)
library(multcomp)
library(GoodmanKruskal)
library(gridExtra)
library(scales) # For the percent_format() function
library("cowplot")
#options(kableExtra.latex.load_packages = FALSE)
library(kableExtra)
library(phonR)
library(grid)
library(RColorBrewer)
library(tictoc)
Arabic <- read.csv("SpeakingRate24.csv")
Vratio <- read.csv("Vratio.csv")
Arabic <- subset(Arabic, select = -Arabic_phrase) ### Supprimer la colonne des phrases en arabe pour éviter les problèmes avec PdfLaTex lors de la compilation LaTex R. Sinon, utiliser XeLaTex pour l'écriture arabe.
Arabic$CVC <- gsub(' ', '', Arabic$CVC)#supprimer les espaces
Arabic$V <- gsub(' ', '', Arabic$V)#supprimer les espaces
Arabic$Length <- gsub(' ', '', Arabic$Length)#supprimer les espaces
Arabic$f0ons <- as.integer(gsub('--undefined--', NA, Arabic$f0ons))
Arabic$f0mid <- as.integer(gsub('--undefined--', NA, Arabic$f0mid))
Arabic$f0off <- as.integer(gsub('--undefined--', NA, Arabic$f0off))
Arabic <- dplyr::mutate_if(Arabic, is.character, as.factor) ## Transformer tous les variables de type "character" Ã des facteurs.
#Arabic <- filter(Arabic, V!="e:" & V!="o:")
Arabic$V = factor(Arabic$V, levels = c('i','a','u','i:','a:','u:','e:','o:')) ## ordonner l'ordre de l'apparition V
Arabic$C <- factor(Arabic$C, levels=c("b","d","g","t","k")) ## ordonner l'ordre de l'apparition C
Arabic$VOTi <- as.integer(Arabic$VOTi)
#Arabic$Word_V_ratio <- as.numeric(gsub(',', '.', Arabic$Word_V_ratio)) #remplacer les virgules en points dans les nombres décimaux pour pouvoir faire des calculs.
levels(Arabic$Rate) <- list("rapide" = "fast", # Change factor levels
"moyen" = "normal",
"lent" = "slow")
levels(Arabic$Length) <- list("longue" = "long", # Change factor levels
"courte" = "short")
Arabic <- dplyr::rename(Arabic, Debit = Rate, Longueur = Length)
Arabic$F1midnor <- with(Arabic, normLobanov(F1mid)) #normalisation de F1mid et F2mid
Arabic$F2midnor <- with(Arabic, normLobanov(F2mid)) #normalisation de F1mid et F2mid
Vratio <- dplyr::rename(Vratio, Debit = Rate)
### sous-ensemble 1
ArabicSub1 <- Arabic
ArabicSub1 <- ArabicSub1 %>%
filter(Timbre %in% c("i", "a", "u")) %>% droplevels()
### sous-ensemble 2
ArabicSub2 <- Arabic
ArabicSub2 <- ArabicSub2 %>%
filter(V %in% c("i", "a", "u", "e:", "u:", "a:")) %>% droplevels()
ArabicSub2$Timbre=gsub('i','e', ArabicSub2$Timbre)
ArabicSub2$Timbre=gsub('u','o', ArabicSub2$Timbre)
ArabicSub2$Timbre= as.factor(ArabicSub2$Timbre)
Arabic %>%
ggplot(aes(y = Duration, x = Debit, colour = Sex)) +
geom_violin() +
geom_jitter(position = position_jitter(seed = 1, width = 0.2)) +
geom_smooth(aes(x = as.numeric(Debit), y = Duration), method = "lm", color = "blue") +
facet_grid(~ V)
`geom_smooth()` using formula = 'y ~
x'
Arabic %>%
ggplot(aes(y = F1midnor, x = Debit, colour = Sex)) +
geom_violin() +
geom_jitter(position = position_jitter(seed = 1, width = 0.2)) +
geom_smooth(aes(x = as.numeric(Debit), y = F1midnor), method = "lm", color = "blue") +
facet_grid(~ V)
`geom_smooth()` using formula = 'y ~
x'
Arabic %>%
ggplot(aes(y = F2midnor, x = Debit, colour = Sex)) +
geom_violin() +
geom_jitter(position = position_jitter(seed = 1, width = 0.2)) +
geom_smooth(aes(x = as.numeric(Debit), y = F2midnor), method = "lm", color = "blue") +
facet_grid(~ V)
`geom_smooth()` using formula = 'y ~
x'
Arabic %>%
ggplot(aes(y = Word_V_ratio, x = Debit, colour = Sex)) +
geom_violin() +
geom_jitter(position = position_jitter(seed = 1, width = 0.2)) +
geom_smooth(aes(x = as.numeric(Debit), y = Word_V_ratio), method = "lm", color = "blue") +
facet_grid(~ V)
`geom_smooth()` using formula = 'y ~
x'
Vratio %>%
ggplot(aes(y = Vratio, x = Debit, colour = Sex)) +
geom_violin() +
geom_jitter(position = position_jitter(seed = 1, width = 0.2)) +
facet_grid(~ Timbre)
Arabic %>%
ggplot(aes(y = F1midnor, x = Debit, colour = Sex)) +
geom_violin() +
geom_jitter(position = position_jitter(seed = 1, width = 0.2)) +
geom_smooth(aes(x = as.numeric(Debit), y = F1midnor), method = "lm", color = "blue") +
facet_grid(~ Timbre)
`geom_smooth()` using formula = 'y ~
x'
Arabic %>%
ggplot(aes(y = F2midnor, x = Debit, colour = Sex)) +
geom_violin() +
geom_jitter(position = position_jitter(seed = 1, width = 0.2)) +
geom_smooth(aes(x = as.numeric(Debit), y = F2midnor), method = "lm", color = "blue") +
facet_grid(~ Timbre)
`geom_smooth()` using formula = 'y ~
x'
ArabicSub1 %>%
ggplot(aes(y = F1midnor, x = Debit, colour = Sex)) +
geom_violin() +
geom_jitter(position = position_jitter(seed = 1, width = 0.2)) +
geom_smooth(aes(x = as.numeric(Debit), y = F1midnor), method = "lm", color = "blue") +
facet_grid(~ Timbre)
`geom_smooth()` using formula = 'y ~
x'
ArabicSub1 %>%
ggplot(aes(y = F2midnor, x = Debit, colour = Sex)) +
geom_violin() +
geom_jitter(position = position_jitter(seed = 1, width = 0.2)) +
geom_smooth(aes(x = as.numeric(Debit), y = F2midnor), method = "lm", color = "blue") +
facet_grid(~ Timbre)
`geom_smooth()` using formula = 'y ~
x'
ArabicSub2 %>%
ggplot(aes(y = F1midnor, x = Debit, colour = Sex)) +
geom_violin() +
geom_jitter(position = position_jitter(seed = 1, width = 0.2)) +
geom_smooth(aes(x = as.numeric(Debit), y = F1midnor), method = "lm", color = "blue") +
facet_grid(~ Timbre)
`geom_smooth()` using formula = 'y ~
x'
ArabicSub2 %>%
ggplot(aes(y = F2midnor, x = Debit, colour = Sex)) +
geom_violin() +
geom_jitter(position = position_jitter(seed = 1, width = 0.2)) +
geom_smooth(aes(x = as.numeric(Debit), y = F2midnor), method = "lm", color = "blue") +
facet_grid(~ Timbre)
`geom_smooth()` using formula = 'y ~
x'
sessionInfo()
R version 4.4.1 (2024-06-14 ucrt)
Platform: x86_64-w64-mingw32/x64
Running under: Windows 10 x64 (build 19045)
Matrix products: default
locale:
[1] LC_COLLATE=English_United Kingdom.utf8
[2] LC_CTYPE=English_United Kingdom.utf8
[3] LC_MONETARY=English_United Kingdom.utf8
[4] LC_NUMERIC=C
[5] LC_TIME=English_United Kingdom.utf8
time zone: Europe/Paris
tzcode source: internal
attached base packages:
[1] grid stats graphics
[4] grDevices utils datasets
[7] methods base
other attached packages:
[1] tictoc_1.2.1
[2] RColorBrewer_1.1-3
[3] phonR_1.0-7
[4] kableExtra_1.4.0
[5] cowplot_1.1.3
[6] scales_1.3.0
[7] gridExtra_2.3
[8] GoodmanKruskal_0.0.3
[9] multcomp_1.4-26
[10] TH.data_1.1-2
[11] MASS_7.3-61
[12] survival_3.7-0
[13] mvtnorm_1.2-6
[14] nlme_3.1-166
[15] RcmdrMisc_2.9-1
[16] sandwich_3.1-0
[17] car_3.1-2
[18] carData_3.0-5
[19] lubridate_1.9.3
[20] forcats_1.0.0
[21] stringr_1.5.1
[22] purrr_1.0.2
[23] readr_2.1.5
[24] tidyr_1.3.1
[25] tibble_3.2.1
[26] tidyverse_2.0.0
[27] ggplot2_3.5.1
[28] dplyr_1.1.4
[29] lmerTest_3.1-3
[30] colorspace_2.1-1
[31] lme4_1.1-35.5
[32] Matrix_1.7-0
loaded via a namespace (and not attached):
[1] tidyselect_1.2.1
[2] viridisLite_0.4.2
[3] farver_2.1.2
[4] fastmap_1.2.0
[5] digest_0.6.37
[6] rpart_4.1.23
[7] timechange_0.3.0
[8] lifecycle_1.0.4
[9] cluster_2.1.6
[10] magrittr_2.0.3
[11] compiler_4.4.1
[12] sass_0.4.9
[13] rlang_1.1.4
[14] Hmisc_5.1-3
[15] tools_4.4.1
[16] utf8_1.2.4
[17] yaml_2.3.10
[18] data.table_1.16.0
[19] knitr_1.48
[20] labeling_0.4.3
[21] htmlwidgets_1.6.4
[22] xml2_1.3.6
[23] abind_1.4-5
[24] withr_3.0.1
[25] foreign_0.8-86
[26] numDeriv_2016.8-1.1
[27] nnet_7.3-19
[28] fansi_1.0.6
[29] e1071_1.7-14
[30] cli_3.6.3
[31] rmarkdown_2.28
[32] generics_0.1.3
[33] rstudioapi_0.16.0
[34] tzdb_0.4.0
[35] readxl_1.4.3
[36] cachem_1.1.0
[37] minqa_1.2.8
[38] proxy_0.4-27
[39] splines_4.4.1
[40] cellranger_1.1.0
[41] base64enc_0.1-3
[42] vctrs_0.6.5
[43] boot_1.3-30
[44] jsonlite_1.8.8
[45] hms_1.1.3
[46] Formula_1.2-5
[47] htmlTable_2.4.3
[48] systemfonts_1.1.0
[49] nortest_1.0-4
[50] jquerylib_0.1.4
[51] glue_1.7.0
[52] nloptr_2.1.1
[53] codetools_0.2-20
[54] stringi_1.8.4
[55] gtable_0.3.5
[56] munsell_0.5.1
[57] pillar_1.9.0
[58] htmltools_0.5.8.1
[59] R6_2.5.1
[60] evaluate_0.24.0
[61] lattice_0.22-6
[62] haven_2.5.4
[63] backports_1.5.0
[64] bslib_0.8.0
[65] class_7.3-22
[66] Rcpp_1.0.13
[67] svglite_2.1.3
[68] checkmate_2.3.2
[69] mgcv_1.9-1
[70] xfun_0.47
[71] zoo_1.8-12
[72] pkgconfig_2.0.3