tests/testthat/test-min_distance.R

### Min_distance

test_that("Test whether the minimum distance calculation works", {

  cartesian <- data.table(X = c(0, 0, 0, 0, 0, 0, 0, 0),
                          Y = c(0, 0, 1, 1, 1, -1, -1, -1),
                          Z = c(0, 10, 0, 5, 10, 0, 5, 10))

  to_test <- min_distance(cartesian)

  expect_equal(to_test, 1, info = "Min distance")
})

Try the rTLS package in your browser

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

rTLS documentation built on Dec. 28, 2022, 1:28 a.m.