tests/testthat/test-caliper_relevance_new.R

sotw_all <- cbind(
    subset(bikes_d_log, select = c(t, temp, hum, windspeed)),
    time = bikes_d_log$t / sqrt(var(bikes_d_log$t))
)

# bikes_atom

plupp <- caliper_relevance_new(
  bikes_atom,
  sotw_all,
  start_agg = 728,
  cw = 1,
  matching_vars = NULL
)


test_that("Similarity matrix is the same", {
  expect_equal(sum(plupp[, "similarity"]), 526)
})

test_that("Returns data table", {
  expect_s3_class(plupp, "data.table")
})
ooelrich/oscbvar documentation built on Sept. 8, 2021, 3:31 p.m.