tests/testthat/test-analyze_tokens.R

test_that("Analyze tokens function", {
  expected_analyze_tokens <- data.frame(word = c("chuck", "wood", "woodchuck"),
                                        n = c(2, 2, 2))
  expect_equal(dim(analyze_tokens(in_text = c("How much wood would a woodchuck 
  chuck if a woodchuck could chuck wood?"))),
               dim(expected_analyze_tokens))
})

Try the textanalyzer package in your browser

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

textanalyzer documentation built on April 3, 2025, 11:55 p.m.