tests/testthat/test_points2par.R

context("From two points to line straight line parameters")





test_that("Convert", {
  myTB <- dplyr::tribble(
    ~time , ~indic,
    1    ,   25,
    10   ,   5,
    1,       10,
    10,       3
    )

  resparamIT <- points2par(as.numeric(myTB[1,]),as.numeric(myTB[2,]))
  #resparamIT
  model <- lm(indic~time,data=myTB[1:2,])
  expect_equal(as.numeric(model$coefficients) , resparamIT)

})

Try the convergEU package in your browser

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

convergEU documentation built on May 29, 2024, 11:15 a.m.