plot_rpvi: Plot rPVI C

View source: R/plot_rpvi_c.R

plot_rpviR Documentation

Plot rPVI C

Description

This function loads a dataframe as input and returns a box plot for rPVI C values.

Usage

plot_rpvi(
  df,
  c_label,
  utterance_id,
  cv_duration,
  save_fig = FALSE,
  fig_path = NULL
)

Arguments

df:

a data frame containing cv_labels, utterance_id, and cv_duration values.

c_label:

a string to filter the consonants, e.g. c_label = 'C' or c_label = 'consonant'

utterance_id:

each unique utterance should have a unique id

cv_duration:

the duration of C or V (only the values for vowels will be used)

Value

A boxplot for rPVI C values.

Author(s)

Cong Zhang, cong.zhang@ru.nl

Examples

df <- data.frame (cv_label  = c("consonant", "vowel", "consonant", "vowel",
                                "consonant", "vowel", "consonant", "vowel"),
                  utterance_id = c("utt_1", "utt_1", "utt_2", "utt_2",
                                   "utt_1", "utt_1", "utt_2", "utt_2"),
                  cv_duration = c(0.1, 0.8, 0.2, 0.5, 0.3, 0.3, 0.4, 0.7))

# Saving the plot
plot_rpvi(df, c_label="consonant", utterance_id, cv_duration, save_fig=T, fig_path='C:/Users/congzhang/Desktop/')

# Not saving the plot
plot_rpvi(df, c_label="consonant", utterance_id, cv_duration, save_fig=FALSE, fig_path=NULL)


congzhang365/rhythm.metrics documentation built on March 31, 2024, 5:57 p.m.