tests/testthat/test_center_fixations.R

context("centering")
options(future.rng.onMisue = "ignore")

test_that("can center a fixation_group", {
  x <- runif(10)
  y <- runif(10)
  onset <- seq(1,length.out=length(x), by=50)
  duration <- rep(1,length(x))
  fixgroup <- fixation_group(x,y,onset,duration)
  cfix <- center(fixgroup)
  expect_true(mean(cfix$x) == 0)
  expect_true(mean(cfix$y) == 0)
})
bbuchsbaum/eyesim documentation built on May 9, 2023, 3:29 a.m.