tests/testthat/test-tidy_indice.R

df <- system.file("extdata", "life_expectancy_years.csv",
                  package = "tidygapminder")

test_that("Output a data frame", {
  expect_true(is.data.frame(tidy_indice(df)))
})

test_that("Colnames are right", {
  expect_equal(colnames(tidy_indice(df)),
               c("country", "year", "life_expectancy_years"))
})

Try the tidygapminder package in your browser

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

tidygapminder documentation built on Feb. 4, 2020, 9:08 a.m.