9장

1.데이터 생성

raw_df <- read.table("e:/R_Project/all_data.txt",header = T)
df <- raw_df

2.전처리

table(is.na(df$speed))
## 
## FALSE 
##  4542
table(df$speed)
## 
##     fast habitual     slow 
##     1509     1515     1518

3.vowel_speakingrate 그래프 만들기

vowel_speakingrate <- df %>% 
  filter(phoneme %in% c("AE1","EH1","IH1")) %>%
  group_by(voice,speed) %>%
  summarise(mean_duration=mean(duration))
## `summarise()` has grouped output by 'voice'. You can override using the `.groups` argument.
ggplot(vowel_speakingrate,aes(x=speed,y=mean_duration,fill=voice)) + geom_col(position="dodge")

4.coda_speakingrate 그래프 만들기

coda_speakingrate <- df %>%
  filter(phoneme %in% c("G","K","T")) %>%
  group_by(voice,speed) %>%
  summarise(mean_duration=mean(duration))
## `summarise()` has grouped output by 'voice'. You can override using the `.groups` argument.
ggplot(coda_speakingrate,aes(x=speed,y=mean_duration,fill=voice)) + geom_col(position = "dodge")

5.vowel_position 그래프 만들기

vowel_position <- df %>%
  filter(phoneme %in% c("AE1","EH1","IH1")) %>%
  group_by(voice,position) %>%
  summarise(mean_duration=mean(duration))
## `summarise()` has grouped output by 'voice'. You can override using the `.groups` argument.
ggplot(vowel_position,aes(x=position,y=mean_duration,fill=voice)) + geom_col(position = "dodge")

6 .coda_position 그래프 만들기

coda_position <- df %>%
  filter(phoneme %in% c("G","K","T")) %>%
  group_by(voice,position) %>%
  summarise(mean_duration=mean(duration))
## `summarise()` has grouped output by 'voice'. You can override using the `.groups` argument.
ggplot(coda_position,aes(x=position,y=mean_duration,fill=voice)) + geom_col(position = "dodge")

7.vowel_height 그래프 만들기

vowel_height <- df %>%
  filter(phoneme %in% c("AE1","EH1","IH1")) %>%
  group_by(voice,height) %>%
  summarise(mean_duration=mean(duration))
## `summarise()` has grouped output by 'voice'. You can override using the `.groups` argument.
ggplot(vowel_height,aes(x=height,y=mean_duration,fill=voice)) + geom_col(position = "dodge")

8.coda_height 그래프 만들기

coda_height <- df %>%
  filter(phoneme %in% c("G","K","T")) %>%
  group_by(voice,height) %>%
  summarise(mean_duration=mean(duration))
## `summarise()` has grouped output by 'voice'. You can override using the `.groups` argument.
ggplot(coda_height,aes(x=height,y=mean_duration,fill=voice)) + geom_col(position = "dodge")