Nothing
n <- 40
set.seed(101)
df <- data.frame(
A = sample(LETTERS[1:4], n, T),
B = rnorm(n)
)
df[40,1] <- "E"
.tra <- LimitedShuffler$new()
test_that("LimitedShuffler works", {
expect_character(.tra$transform(df$A))
expect_equal(length(.tra$transform(df$A)), n)
expect_numeric(.tra$transform(df$B))
expect_equal(length(.tra$transform(df$B)), n)
.mut <- .tra$mutate(df, A)
expect_data_frame(.mut)
expect_equal(nrow(.mut), n)
.mut <- .tra$mutate(df, B)
expect_data_frame(.mut)
expect_equal(nrow(.mut), n)
})
test_that("Grouped Shuffler works", {
shuffled <- .tra$group_and_mutate(df, A, B)
E <- filter(shuffled, A == "E")
expect_true(is.na(E$B))
})
Any scripts or data that you put into this service are public.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.