tests/testthat/test_cutoffs.R

context("cutoffs")

test_that("cut-points of ordinal variables works", 
  {
	d <- structure(c(2,0, 1, 1, 1, 0, 1, 1, 0, 2, 0, 2, 2, 1, 2, 2, 1, 0, 0, 1, 1, 1, 0, 0, 1, 0, 2, 0, 2, 2), .Dim = c(5L, 6L))
    res1 <- cutoffs(d)   
	
	  expect_equal( res1, structure(c(-Inf, -Inf, -Inf, -Inf, -Inf, -Inf, -0.841621233572914, 
-0.2533471031358, -0.841621233572914, -0.2533471031358, -0.2533471031358, 
-0.2533471031358, 0.841621233572914, 0.841621233572914, -0.2533471031358, 
0.841621233572914, Inf, -0.2533471031358, Inf, Inf, Inf, Inf, 
Inf, Inf), .Dim = c(6L, 4L))  )  
   })

Try the netgwas package in your browser

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

netgwas documentation built on May 29, 2024, 5:33 a.m.