tests/testthat/test_get_eloscores.R

context("Calculate Elo score for an individual")
library(bwsTools)

test_that("K is working as it should", {
  res <- get_eloresults(indiv[indiv$id == 2, ], "block", "label", "value")
  set.seed(1839); res1 <- get_eloscores(res, K = 1, iter = 1)
  set.seed(1839); res2 <- get_eloscores(res, K = 100, iter = 1)
  expect_true(var(res1$elo) < var(res2$elo))
})

Try the bwsTools package in your browser

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

bwsTools documentation built on Aug. 27, 2020, 1:10 a.m.