Error in `lme4::lFormula(formula = similarity ~ 1 + (1 | dyad_id), data = model_data, 
    control = structure(list(optimizer = "nloptwrap", restart_edge = TRUE, 
        boundary.tol = 1e-05, calc.derivs = TRUE, use.last.params = FALSE, 
        checkControl = list(check.nobs.vs.rankZ = "ignore", check.nobs.vs.nlev = "stop", 
            check.nlev.gtreq.5 = "ignore", check.nlev.gtr.1 = "stop", 
            check.nobs.vs.nRE = "stop", check.rankX = "message+drop.cols", 
            check.scaleX = "warning", check.formula.LHS = "stop"), 
        checkConv = list(check.conv.grad = list(action = "warning", 
            tol = 0.002, relTol = NULL), check.conv.singular = list(
            action = "message", tol = 1e-04), check.conv.hess = list(
            action = "warning", tol = 1e-06)), optCtrl = list()), class = c("lmerControl", 
    "merControl")))`: 0 (non-NA) cases

load(system.file("extdata", "dyad_example_data.Rdata", package = "conversim"))
# Test for test_topic_sim_dyads function
result <- test_topic_sim_dyads(dyad_example_data, method = "lda", num_topics = 2, window_size = 3)
expect_true(result$average_similarity >= 0 && result$average_similarity <= 1)
# Test for test_semantic_sim_dyads function
result <- test_semantic_sim_dyads(dyad_example_data, method = "tfidf", window_size = 3)
# Test for test_stylistic_sim_dyads function
result <- test_stylistic_sim_dyads(dyad_example_data, window_size = 3)
test_that("All similarity methods produce consistent results", {
topic_result <- test_topic_sim_dyads(dyad_example_data, method = "lda", num_topics = 2, window_size = 3)
semantic_result <- test_semantic_sim_dyads(dyad_example_data, method = "tfidf", window_size = 3)
stylistic_result <- test_stylistic_sim_dyads(dyad_example_data, window_size = 3)

"All similarity methods produce consistent results"

Error in `.dsy2dpo(.M2sym(from))`: not a positive definite matrix (and positive semidefiniteness is not checked)

Error in `sum(sapply(words, function(w) max(1, nchar(gsub("[^aeiouAEIOU]", 
    "", w)))))`: invalid 'type' (list) of argument

All similarity methods produce consistent results