tests/testthat/test-distanceFromTo.R

test_that("multiplication works", {
  x1 <- structure(c(1L, 1L, 4L, 3L, 4L, 5L, 3L, 1L, 1L, 1L, 2L, 5L), .Dim = 4:3)
  x2 <- structure(c(4L, 5L, 2L, 5L, 4L, 1L), .Dim = 2:3)
  # euc
  # (1,4,1) -- (4,2,4) --> 9+4+9 = sqrt(22) = 4.690416
  # (1,4,1) -- (5,5,1) --> 16+1+0 = sqrt(17) = 4.123106
  # (1,5,1) -- (4,2,4) --> 9+9+9 = sqrt(27) = 5.196152
  # (1,5,1) -- (5,5,1) --> 16+0+0 = sqrt(16) = 4
})
noeliarico/dists documentation built on May 27, 2020, 9:45 a.m.