pathology_mouse_models <- levels(dplyr::bind_rows(pathology)[["mouse_model"]])
test_that("expand_mouse_model_factor_from_selection only includes factors selected", {
mouse_model_selection <- pathology_mouse_models
output <- pathology %>%
dplyr::bind_rows() %>%
expand_mouse_model_factor_from_selection(mouse_model_selection)
expect_equal(levels(output[["mouse_model"]]), mouse_model_selection)
mouse_model_selection <- pathology_mouse_models[[1]]
output <- pathology %>%
dplyr::bind_rows() %>%
dplyr::filter(mouse_model %in% mouse_model_selection) %>%
expand_mouse_model_factor_from_selection(mouse_model_selection)
expect_equal(levels(output[["mouse_model"]]), mouse_model_selection)
mouse_model_selection <- pathology_mouse_models[[2]]
output <- pathology %>%
dplyr::bind_rows() %>%
dplyr::filter(mouse_model %in% mouse_model_selection) %>%
expand_mouse_model_factor_from_selection(mouse_model_selection)
expect_equal(levels(output[["mouse_model"]]), mouse_model_selection)
})
test_that("expand_mouse_model_factor_from_selection includes factors selected, even if they don't have any data", {
mouse_model_selection <- pathology_mouse_models
output <- pathology %>%
dplyr::bind_rows() %>%
dplyr::filter(mouse_model %in% pathology_mouse_models[[2]]) %>%
expand_mouse_model_factor_from_selection(mouse_model_selection)
expect_equal(levels(output[["mouse_model"]]), mouse_model_selection)
})
test_that("expand_mouse_model_factor_from_selection returns factor levels in the same order as the selection", {
mouse_model_selection <- pathology_mouse_models
output <- pathology %>%
dplyr::bind_rows() %>%
expand_mouse_model_factor_from_selection(mouse_model_selection)
expect_equal(levels(output[["mouse_model"]]), mouse_model_selection)
mouse_model_selection <- pathology_mouse_models
output <- pathology %>%
dplyr::bind_rows() %>%
expand_mouse_model_factor_from_selection(mouse_model_selection)
expect_equal(levels(output[["mouse_model"]]), mouse_model_selection)
})
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.