context("Repeating factors")
test_that("frep repeats factors (or character)", {
x <- "cat"
n <- 3
out <- c("cat","cat","cat")
expect_identical(frep(x, n), out)
expect_identical(frep(x), "cat")
expect_error(frep(x,-1))
})
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.