tests/testthat/test-plyr.R

test_that("llply works", {
  x <- list(a = 1:10, beta = exp(-3:3), logic = c(TRUE, FALSE, FALSE, TRUE))
  r1 = llply(x, mean, .progress = "text")
  r2 = llply(x, ~ mean(.x), .progress = TRUE)
  expect_equal(r1, r2)

  r1 = laply(x, mean, .progress = "none")
  r2 = laply(x, ~ mean(.x), .progress = FALSE)
  expect_equal(r1, r2)
})
kongdd/Ipaper documentation built on March 27, 2024, 5:34 a.m.