tests/testthat/test-Election1999.R

context("Checking the Election 1999 Data")
test_that("Year of the Election",{
  expect_equal(unique(Election1999$Year),1999)
})

test_that("No of Columns",{
  expect_equal(ncol(Election1999),6)
})

test_that("Obtaining the Districts",{
  expect_equal(length(unique(Election1999$District)),22)
})

test_that("Obtaining the Electorate",{
  expect_equal(length(unique(Election1999$Electorate))-2,160)
})

Try the SLPresElection package in your browser

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

SLPresElection documentation built on Jan. 17, 2023, 5:10 p.m.