tests/testthat/test.makepath.R

context("makepath")

data(powerplant)

ncentroids <- 20
ninterp <- 4
pathobject <- makepath(x = powerplant, ncentroids = ncentroids, ninterp =
  ninterp)

test_that("makepath returns dataframes with correct names", {
  expect_equal(names(pathobject$path), names(powerplant))
  expect_equal(names(pathobject$centers), names(powerplant))
})

test_that("makepath returns the correct number of centers and path points", {
  expect_equal(nrow(pathobject$centers), ncentroids)
  expect_equal(nrow(pathobject$path), ncentroids + (ncentroids - 1L) * ninterp)
})

Try the condvis package in your browser

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

condvis documentation built on May 2, 2019, 5:57 a.m.