tests/testthat/test-arrange.r

context("Arrange")

test_that("bogus sort order", {
  expect_error(arrange(mtcars, diff(mpg)), "Length of ordering vectors")
})

test_that("descending sort", {
  expect_equal(arrange(mtcars, desc(mpg)), arrange(mtcars, -mpg))
})

Try the plyr package in your browser

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

plyr documentation built on Oct. 2, 2023, 9:07 a.m.