tests/testthat/test-datasets.R

# ------------------------------------------------------------
test_that("Links79Pair", {
  expectedColumnCount <- 5
  actualColumnCount <- ncol(Links79Pair)
  expect_equal(actualColumnCount, expectedColumnCount, info = "The number of columns should be correct.")

  expectedRowCount <- 42836 # 42773 #42714 #11075
  actualRowCount <- nrow(Links79Pair)
  expect_equal(actualRowCount, expectedRowCount, info = "The number of rows should be correct.")
})

test_that("Links79PairExpanded", {
  expectedColumnCount <- 26
  actualColumnCount <- ncol(Links79PairExpanded)
  expect_equal(actualColumnCount, expectedColumnCount, info = "The number of columns should be correct.")

  expectedRowCount <- 42836 # 42773 #42714 #11075
  actualRowCount <- nrow(Links79PairExpanded)
  expect_equal(actualRowCount, expectedRowCount, info = "The number of rows should be correct.")
})

Try the NlsyLinks package in your browser

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

NlsyLinks documentation built on Oct. 10, 2024, 5:08 p.m.