tests/testthat/test_inRegion.r

context("In Region")

test_that("applyGate correctly identifies point within region", {
    t1 <- applyGate(matrix(c(0,0), 1), rbind.data.frame(c(1,1), c(-1,1), c(-1,-1), c(1,-1)))
    t2 <- applyGate(matrix(c(2,2), 1), rbind.data.frame(c(1,1), c(-1,1), c(-1,-1), c(1,-1)))
    expect_true(t1)
    expect_false(t2)
})

Try the gatepoints package in your browser

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

gatepoints documentation built on Aug. 20, 2023, 9:06 a.m.