tests/testthat/test-distance.R

test_that("`distance()` works", {
  expect_true(is.numeric(distance(x = runif(100), y = runif(100), distance = "euclidean")))

  expect_true(distance(x = 1, y = 1) == 0)
})

Try the distantia package in your browser

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

distantia documentation built on April 4, 2025, 5:42 a.m.