########################################################################################### ### R code for the paper "Manner of motion in Estonian: A descriptive account of speed" ### ########################################################################################### # Authors: Piia Taremaa and Anetta Kopecka # Journal: Studies in Language # Status of the paper: accepted ################ ### PACKAGES ### ################ library(dplyr) library(ggplot2) library(sjPlot) library(ggpubr) library(Rcmdr) ################ ### DATASETS ### ################ ### DATA 1 ### verbspeed = read.delim("PSG41.txt", header=T, encoding = "UTF-8") verbspeed <- verbspeed %>% mutate_if(is.character,as.factor) str(verbspeed) verbspeed$Verb <- factor(verbspeed$Verb, levels = verbspeed$Verb[order(verbspeed$VerbSpeed)]) verbspeed$VerbType = factor(verbspeed$VerbType, levels = c("MannerVerb", "SourceVerb", "GoalVerb")) ### DATA 2 ### man = read.delim("TaremaaKopecka_speed_21.11.21.txt", sep = "\t", header = T, encoding = "UTF-8") man <- man %>% mutate_if(is.character,as.factor) man$VerbType = factor(man$VerbType, levels = c("MannerVerb", "SourceVerb", "GoalVerb")) man$MannerBroad = factor(man$MannerBroad, levels = c("yes", "no")) man$Speed = factor(man$Speed, levels = c("yes", "no")) man$SlowOrFast = factor(man$SlowOrFast, levels = c("slow", "fast", "variable")) man$VerbSpeedBinned <- with(man, binVariable(VerbSpeed, bins=3, method='natural', labels=c('SlowVerbs','MediumVerbs','FastVerbs'))) # clustering in Rcmdr colnames(man) head(man) str(man) nrow(man) ############## ### TABLES ### ############## ### Table 1. Manner modifiers of narrow scope # Instrument.Vehicle [==Vehicle], Speed, BodyMovements [==BodyMovements+OtherNarrow], Trajectory, FundConcepts, PostureWithoutPossession [==Posture/Position], PhysicalCond summary(man) # The total number of manner modifiers of narrow scope A = filter(man, MannerNarrow == "yes") nrow(A) # 1447 ### Table 2. Manner modifiers of medium scope # Emotion, Appearance.FaceClothing. [==Appearance], Possession, Sound, QualityOfMotion [==Quality], Observability summary(man) # The total number of manner modifiers of narrow scope and medium scope 1447+1029 # 2476 # The total number of clauses containing manner modifiers of narrow scope and/or medium scope B = filter(man, MannerNarrow == "yes" | MannerMedium == "yes") nrow(B) # 2344 ### Table 3. Manner modifiers of broad scope # OtherClearManner [==Other], NumberOfMovers, EnvirCharact [==Environment/atmosphere], Suddenness summary(man) # The total number of manner modifiers of narrow, medium, and broad scope 1447+1029+477 # 2953 # The total number of clauses containing manner modifiers of narrow, medium, and/or broad scope (control) C = filter(man, MannerNarrow == "yes" | MannerMedium == "yes" | MannerLessClear == "yes") nrow(C) # 2780 ############### ### FIGURES ### ############### ### Figure 2. Standardised mean speed ratings of the verbs. The smaller the mean, the slower the verb, and the larger the mean, the faster the verb set_theme(geom.label.angle = 00, axis.textcolor.x = "black", axis.textcolor.y = "black", geom.outline.color = "gray50", geom.outline.size = 0.5, geom.label.color = "black", axis.angle.x = 0, axis.textcolor = "black", base = theme_bw(), legend.pos = "bottom") (verbplot <-ggplot(verbspeed, aes(x=VerbSpeed, y=Verb, fill=VerbType)) + geom_dotplot(binaxis='y', stackdir='center', dotsize=0.5) + scale_fill_manual(values=c("gray98", "gray70", "black")) + theme(legend.position=c(0.8, 0.1), legend.direction="vertical")) # dot plot ### Figure 3. A: formal realisations of speed modifiers. B: formal realisations of manner modifiers of broad scope (speed modifiers included) (p8 = plot_frq(man, SpeedForm, coord.flip = T, sort.frq = "asc", show.na = F, geom.colors = "gray90", hjust = "inward", vjust = "middle")) (p9 = plot_frq(man, MannerForm, coord.flip = T, sort.frq = "asc", show.na = F, geom.colors = "gray90", hjust = "inward", vjust = "middle")) (figure <- ggarrange(p8, p9, labels = c("A", "B"), ncol = 2, nrow = 1)) ### Figure 4. The morphosyntactic realisation of speed modifiers across slow, fast, and variable motion man$SpeedForm = factor(man$SpeedForm, levels = c("AdpP", "Comparison", "NP_part", "Combination", "NP_ine", "Gerund", "QuantP", "NP_ade", "NP_com", "AdvP")) man2 <- man %>% group_by(SpeedForm) %>% mutate(count_name_occurr = n()) ggplot(data=subset(man2, !is.na(SpeedForm)), aes(x=SpeedForm, fill=SlowOrFast))+ geom_bar(position="fill") + scale_y_continuous(labels = scales::percent) + scale_fill_manual(values=c("gray95", "gray65", "gray40")) + geom_text(aes(label=..count..), stat='count', position=position_fill(vjust=0.5)) + xlab("Morphosyntactic form of speed modifiers") + ylab("") + coord_flip() ### Figure 5. A: the presence (= yes) or absence (= no) of speed modifiers across verb types. B: the presence (= yes) or absence (= no) of manner modifiers (broad scope, speed modifiers included) across verb types. (p1 = ggplot(man, aes(x=VerbType, fill=Speed))+ geom_bar(position="fill")+ scale_y_continuous(labels = scales::percent) + scale_fill_manual(values=c("gray95", "gray75")) + geom_text(aes(label=..count..), stat='count', position=position_fill(vjust=0.5))) sjt.xtab(man$VerbType, man$Speed, show.row.prc = T) # statistics (p2 = ggplot(man, aes(x=VerbType, fill=MannerBroad))+ geom_bar(position="fill")+ scale_y_continuous(labels = scales::percent) + scale_fill_manual(values=c("gray95", "gray75")) + geom_text(aes(label=..count..), stat='count', position=position_fill(vjust=0.5))) sjt.xtab(man$VerbType, man$MannerBroad, show.row.prc = T) # statistics (figure <- ggarrange(p1, p2, labels = c("A", "B"), ncol = 2, nrow = 1)) ### Figure 6. A: speed ratings of the verbs across the clauses with the presence (= yes) or absence (= no) of speed modifiers. B: speed ratings of the verbs across the clauses with the presence (= yes) or absence (= no) of manner modifiers (broad scope, speed modifiers included). C: general frequencies of speed modifiers that express fast, slow, or variable speed of motion. D: speed ratings of the verbs across the clauses with speed modifiers that express fast, slow, or variable speed of motion. E: speed modifiers across the verbs grouped into slow, medium, and fast motion. (p3 = ggplot(man, aes(x=Speed, y=VerbSpeed), rev.order = T) + geom_boxplot(notch = T) + xlab("The presence of speed modifiers") + theme(axis.title.x = element_text(face="bold", color="black"))) (p4 = ggplot(man, aes(x=MannerBroad, y=VerbSpeed)) + geom_boxplot(notch = T) + xlab("The presence of manner modifiers") + theme(axis.title.x = element_text(face="bold", color="black"))) (p5 = ggplot(data=subset(man, !is.na(SlowOrFast)), aes(x = SlowOrFast)) + geom_bar(fill = "gray90", colour = "black") + xlab("Speed modifiers") + ylab("Frequency") + geom_text(aes(label=paste0(sprintf("%1.1f", ..count../sum(..count..)*100), "%\n", ..count..), y=0.5*..count..), stat = "count", vjust = 0.3, colour = "black") + theme(axis.title.x = element_text(face="bold", color="black"))) (p6 = ggplot(data=subset(man, !is.na(SlowOrFast)), aes(x=SlowOrFast, y=VerbSpeed)) + geom_boxplot(notch = T) + xlab("Speed modifiers") + theme(axis.title.x = element_text(face="bold", color="black"))) (p7 = ggplot(data=subset(man, !is.na(SlowOrFast)), aes(x=VerbSpeedBinned, fill=SlowOrFast))+ geom_bar(position="fill")+ scale_y_continuous(labels = scales::percent) + scale_fill_manual(values=c("gray95", "gray75", "gray50")) + xlab("Motion verbs") + geom_text(aes(label=..count..), stat='count', position=position_fill(vjust=0.5)) + labs(fill = "Speed modifiers")) sjt.xtab(man$SlowOrFast, man$VerbSpeedBinned, show.row.prc = T, show.col.prc = T) # statistics (figure <- ggarrange(p3, p4, p5, p6, p7, labels = c("A", "B", "C", "D", "E"), ncol = 2, nrow = 3))