tests/testthat/test_as.regions.R

library(polmineR)
use("polmineR")
testthat::context("as.regions")

test_that(
  "coerce to regions",
  {
    p <- partition("GERMAPARLMINI", speaker = "Angela Dorothea Merkel")
    r1 <- as(p, "regions")
    
    sc <- corpus("GERMAPARLMINI") %>% 
      subset(speaker == "Angela Dorothea Merkel")
    r2 <- as(sc, "regions")
    
    expect_identical(r1, r2)
  }
)

Try the polmineR package in your browser

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

polmineR documentation built on Nov. 2, 2023, 5:52 p.m.