tests/testthat/test-top-n.R

context("top_n")

test_that("top_n returns n rows", {
  test_df <- data.frame(x = 1:10, y = 11:20)
  top_four <- test_df %>% top_n(4, y)
  expect_equal(dim(top_four), c(4, 2))
})
sctyner/dplyr050 documentation built on May 17, 2019, 2:22 p.m.