tests/testthat/test-rule-css.R

test_that("rule_css works", {
  data(iris)
  x <- condformat(iris[c(1:10, 51:60, 101:110),])
  y <- x %>% rule_css(Species,
                      expression = ifelse(Species == "setosa",
                                          "red", "darkgreen"),
                      css_field = "color")
  out <- condformat2html(y)
  expect_match(out, "red")
  expect_match(out, "darkgreen")
})

Try the condformat package in your browser

Any scripts or data that you put into this service are public.

condformat documentation built on Oct. 8, 2023, 9:07 a.m.