tests/testthat/test-Election1994.R

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

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

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

test_that("Obtaining the Electorate",{
  expect_equal(length(unique(Election1994$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.