송지원
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<-all_data
head(data)
## 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
속도별 모음의 길이
vowel<-data %>% 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<-data %>% 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_position<-data %>% 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_position<-data %>% filter(phoneme == "K"|phoneme =="G") %>% group_by(position,voice) %>% summarise(coda_duration=mean(duration))
## `summarise()` regrouping output by 'position' (override with `.groups` argument)
그래프 그리기
ggplot(data=coda_position, aes(x=position, y=coda_duration, fill=voice))+geom_col(position="dodge")+scale_x_discrete(limits=c("initial","mid","final"))
변수명 변경
data<-rename(data, vowel_height=height)
모음의 높이에 따른 모음의 길이
vowel_height<-data %>% 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_height<-data %>% 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"))