inst/tinytest/test_desc.R

expect_equal(
  desc(1:10),
  -1:-10,
  info = "desc() returns negative vectors"
)

expect_equal(
  mtcars %>% arrange(desc(mpg)),
  mtcars[order(-mtcars$mpg), ],
  info = "desc() arranges a data.frame in descending order of the chosen column"
)

Try the poorman package in your browser

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

poorman documentation built on Nov. 2, 2023, 5:27 p.m.