tests/testthat/test-lerp.R

test_that("linear interpolation works", {
  expect_equal(2, lerp(a = 2, b = 1, ratio = 0))
  expect_equal(1, lerp(a = 2, b = 1, ratio = 1))
  expect_equal(1.75, lerp(a = 2, b = 1, ratio = 0.25))
})

Try the ggpointless package in your browser

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

ggpointless documentation built on May 29, 2024, 7:16 a.m.