tests/testthat/test_str2id.R

library(RcppCWB)

testthat::context("cl_str2id")

test_that(
  "str2id",
  {
    id <- cl_str2id(
      corpus = "REUTERS",
      p_attribute = "word",
      str = "oil",
      registry = system.file(package = "RcppCWB", "extdata", "cwb", "registry")
    )
    expect_equal(id, 15L)
  }
)

Try the RcppCWB package in your browser

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

RcppCWB documentation built on Oct. 22, 2018, 5:08 p.m.