Nothing
# WARNING - Generated by {fusen} from dev/flat_reshape.Rmd: do not edit by hand # nolint: line_length_linter.
test_that("w2l_split names match the content of each element", {
res <- w2l_split(mtcars, cols = "mpg", by = c("am", "vs"), sep = "|")
for (nm in names(res)) {
k <- strsplit(nm, "|", fixed = TRUE)[[1]]
expect_true(all(mtcars$mpg[mtcars$am == k[2] & mtcars$vs == k[3]] %in% res[[nm]]$value))
}
expect_false(any(c("variable", "am", "vs") %in% names(res[[1]])))
})
test_that("w2l_split honours out_type and leaves the input untouched", {
df <- data.frame(a = 1:4, g = c("x", "x", "y", "y"))
res <- w2l_split(df, by = "g", out_type = "df")
expect_identical(names(res), c("x", "y"))
expect_s3_class(res$x, "data.frame", exact = TRUE)
expect_identical(class(df), "data.frame")
})
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.