tests/testthat/test-tier-to-df.R

test_that("tier_to_df", {
  file_1 <- system.file("extdata", "test.TextGrid", package = "phonfieldwork")
  file_2 <- readLines(system.file("extdata", "test.TextGrid",
                                  package = "phonfieldwork"
  ))
  expect_equal(tier_to_df(file_1)[, 1], 1:5)
  expect_equal(tier_to_df(file_1, tier = "intervals")[, 1], 1:5)
  expect_equal(tier_to_df(file_2)[, 1], 1:5)
  expect_equal(tier_to_df(file_1, tier = 3)[, 1], 1:4) # point tier
})

Try the phonfieldwork package in your browser

Any scripts or data that you put into this service are public.

phonfieldwork documentation built on Sept. 11, 2024, 9:18 p.m.