tests/testthat/test-geodetector.R

test_that("test whether factor_detector function works well", {
  fd = factor_detector(y = 1:7,x = c('x',rep('y',3),rep('z',3)))
  fd = lapply(fd, round, 6)
  expect_equal(fd,
               list(`Q-statistic` = 0.771429,
                    `P-value` = 0.079365))
})

Try the gdverse package in your browser

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

gdverse documentation built on April 3, 2025, 8:40 p.m.