/usr/share/doc/r-cran-dplyr/tests/testthat/test-colwise-arrange.R is in r-cran-dplyr 0.7.4-3.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 | context("colwise arrange")
df <- mtcars[1:3]
test_that("scoped arrange is identical to manual arrange", {
expect_identical(arrange_all(df), arrange(df, mpg, cyl, disp))
expect_identical(arrange_at(df, vars(mpg)), arrange(df, mpg))
expect_identical(arrange_if(iris, is.factor), arrange(iris, Species))
})
test_that(".funs is applied to variables before sorting", {
expect_identical(arrange_all(df, `-`), arrange(df, -mpg, -cyl, -disp))
})
|