다음 데이터를 Ch 9 까지에서 배운 모든 것을 활용하여 분석하여 언어학적으로 의미 있는 결론을 도출해 주기 바랍니다. 구체적으로는 첨부한 그래프 중에서 처음 6개를 재현하는데, line graph 로 해도 되고, 책에서 배운것처럼 dodge 이용해서 막대그래프로 그려도 됩니다. 마지막 네번째 페이지의 그래프는 optional 입니다.

library(dplyr)
## 
## Attaching package: 'dplyr'
## The following objects are masked from 'package:stats':
## 
##     filter, lag
## The following objects are masked from 'package:base':
## 
##     intersect, setdiff, setequal, union
library(ggplot2)
library(readxl)
all_data <- read.table("all_data.txt", header=TRUE)
data_copy <- all_data
head(data_copy)
##   filename phoneme duration item height  voice position speed subj
## 1   tack_f       T   45.338 tack    low -voice    final  fast   F1
## 2   tack_f     AE1  150.627 tack    low -voice    final  fast   F1
## 3   tack_f       K   88.059 tack    low -voice    final  fast   F1
## 4  tack_f1       T   47.490 tack    low -voice    final  fast   F1
## 5  tack_f1     AE1  148.429 tack    low -voice    final  fast   F1
## 6  tack_f1       K  110.553 tack    low -voice    final  fast   F1
dim(data_copy)
## [1] 4542    9

Vowel and coda duration as a function of speaking rate

Vowel duration as a function of speaking rate

library(dplyr)
library(ggplot2)
vowel <- data_copy %>% 
  filter(phoneme == "AE1" | phoneme =="EH1" | phoneme =="IH1") %>% 
  group_by(speed, voice) %>%
  summarise(vowel_duration = mean(duration))
## `summarise()` regrouping output by 'speed' (override with `.groups` argument)
ggplot(data = vowel, aes(x = speed, y = vowel_duration, fill = voice)) +
  geom_col(position = "dodge") + 
  scale_x_discrete(limits = c("fast", "habitual", "slow"))

Coda duration as a function of speaking rate

library(dplyr)
library(ggplot2)
coda <- data_copy %>% filter(phoneme == "K" | phoneme =="G") %>% 
  group_by(speed,voice) %>%
  summarise(coda_duration = mean(duration))
## `summarise()` regrouping output by 'speed' (override with `.groups` argument)
ggplot(data = coda, aes(x = speed, y = coda_duration, fill=voice)) + 
  geom_col(position="dodge") + 
  scale_x_discrete(limits = c("fast", "habitual", "slow"))

Vowel and coda duration as a function of sentence position

Vowel duration as a function of sentence position

vowel_position <- data_copy %>% 
  filter(phoneme == "AE1" | phoneme =="EH1" | phoneme =="IH1") %>% 
  group_by(position, voice) %>%
  summarise(vowel_duration = mean(duration))
## `summarise()` regrouping output by 'position' (override with `.groups` argument)
ggplot(data = vowel_position, aes(x = position, y = vowel_duration, fill = voice)) + 
  geom_col(position = "dodge") + 
  scale_x_discrete(limits = c("initial", "mid", "final"))

Coda duration as a function of sentence position

coda <- data_copy %>% 
  filter(phoneme == "K" | phoneme =="G") %>%
  group_by(speed,voice) %>%
  summarise(coda_duration = mean(duration))
## `summarise()` regrouping output by 'speed' (override with `.groups` argument)
ggplot(data = coda, aes(x = speed, y = coda_duration, fill = voice)) + 
  geom_col(position = "dodge") + 
  scale_x_discrete(limits = c("fast", "habitual","slow"))

Vowel and coda duration as a function of vowel height

Vowel duration as a function of vowel height

library(dplyr)
library(ggplot2)
data_copy <- dplyr::rename(data_copy, vowel_height = height)

vowel_height <- data_copy %>% 
  filter(phoneme == "AE1" | phoneme =="EH1" | phoneme =="IH1") %>% 
  group_by(vowel_height, voice) %>%
  summarise(vowel_duraiton = mean(duration))
## `summarise()` regrouping output by 'vowel_height' (override with `.groups` argument)
ggplot(data = vowel_height, aes(x = vowel_height, y = vowel_duraiton, fill=voice)) + 
  geom_col(position = "dodge") + 
  scale_x_discrete(limits = c ("high", "low", "mid"))

Coda duration as a function of vowel height

library(dplyr)
library(ggplot2)
coda_height <- data_copy %>% 
  filter(phoneme == "K" | phoneme =="G") %>%
  group_by(vowel_height, voice) %>%
  summarise(coda_duration = mean(duration))
## `summarise()` regrouping output by 'vowel_height' (override with `.groups` argument)
ggplot(data = coda_height, aes(x = vowel_height, y = coda_duration, fill = voice)) + 
  geom_col(position = "dodge") + 
  scale_x_discrete(limits = c("high", "low", "mid"))