Nothing
context("Conditional function translations")
test_that("Expression in square brackets in summarise() returns expected result", {
check_impala()
test_op <- function(x) {
x %>%
rename_all(recode, Sepal.Length = "sepal_length") %>%
rename_all(recode, Species = "species") %>%
summarise(result = ceiling(sum(sepal_length[species == "versicolor"], na.rm = TRUE))) %>%
collect() %>%
pull(1) %>%
as.numeric()
}
compare_tbls(list(tbl(impala, "iris"), datasets::iris), op = test_op)
})
test_that("na_if() returns expected result", {
check_impala()
test_op <- function(x) {
x %>%
rename_all(recode, Species = "species") %>%
transmute(mangled = na_if(species, "virginica")) %>%
collect() %>%
arrange(mangled)
as.character()
}
compare_tbls(list(tbl(impala, "iris"), datasets::iris), op = test_op)
})
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.