tests/testthat/test-update_key.R

context("Checking update_key")

test_that("update_key ...",{


    key <- data.frame(
        words = sample(letters),
        polarity = rnorm(26),
        stringsAsFactors = FALSE
    )

    mykey <- as_key(key)

    out <- update_key(mykey, drop = c("f", "h"),
        x = data.frame(x = c("dog", "cat", "rock"), y = c(1, -1, 1), stringsAsFactors = FALSE))

    expect_true(is_key(out))
    expect_equal(nrow(out), 27)

})

Try the sentimentr package in your browser

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

sentimentr documentation built on Oct. 20, 2018, 5:05 p.m.