tests/testthat/test-stylest2_fit.R

library(stylest2)
library(quanteda)

novels_dfm <- dfm(tokens( data(novels) ))

test_that('invalid smooth raises error', {
  expect_error(stylest2_fit(dfm = novels_dfm, smoothing = -1),
               'Smoothing value must be numeric and non-negative.')
  }
)

Try the stylest2 package in your browser

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

stylest2 documentation built on May 29, 2024, 1:50 a.m.