df_to_tier: Dataframe to TextGrid's tier

Description Usage Arguments Value Author(s) Examples

View source: R/df_to_tier.R

Description

Convert a dataframe to a Praat TextGrid.

Usage

1
df_to_tier(df, textgrid, tier_name = "", overwrite = TRUE)

Arguments

df

an R dataframe object that contains columns named "content", "time_start" and "time_end"

textgrid

a character with a filename or path to the TextGrid

tier_name

a vector that contain a name for a created tier

overwrite

a logic argument, if TRUE overwrites the existing TextGrid file

Value

If overwrite is FALSE, then the function returns a vector of strings with a TextGrid. If overwrite is TRUE, then no output.

Author(s)

George Moroz <agricolamz@gmail.com>

Examples

1
2
3
4
5
6
7
8
9
time_start <- c(0.00000000, 0.01246583, 0.24781914, 0.39552363, 0.51157715)
time_end <- c(0.01246583, 0.24781914, 0.39552363, 0.51157715, 0.65267574)
content <- c("", "T", "E", "S", "T")
df_to_tier(my_df <- data.frame(id = 1:5, time_start, time_end, content),
  system.file("extdata", "test.TextGrid",
    package = "phonfieldwork"
  ),
  overwrite = FALSE
)

phonfieldwork documentation built on March 3, 2021, 1:12 a.m.