tests/testthat/test-find_rows_inbag.R

n_obs <- 100

rows_inbag_checker <- function(rows_oobag, n_obs){
 all_rows <- seq(n_obs)-1
 matrix(setdiff(all_rows, rows_oobag), ncol=1)
}

for(i in seq(100)){

 rows_oobag <- sort(sample(x = seq(0, n_obs-1), size = round(n_obs/3)))

 expect_equal(
  find_rows_inbag_exported(rows_oobag, n_obs),
  rows_inbag_checker(rows_oobag, n_obs)
 )

}

Try the aorsf package in your browser

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

aorsf documentation built on Oct. 26, 2023, 5:08 p.m.