R Under development (unstable) (2023-07-19 r84711 ucrt) -- "Unsuffered Consequences" Copyright (C) 2023 The R Foundation for Statistical Computing Platform: x86_64-w64-mingw32/x64 R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R. > library(reclin2) Loading required package: data.table Attaching package: 'reclin2' The following object is masked from 'package:base': identical > source("helpers.R") > > pairs <- data.table( + .x = c(3,3,1,2,3,2), + .y = c(4,5,1,2,1,3), + score = c(1,5,10,5,4,1) + ) > class(pairs) <- c("pairs", class(pairs)) > > t <- select_greedy(pairs, "select", "score") > expect_equal(t$select, c(FALSE, TRUE, TRUE, TRUE, FALSE, FALSE)) > > t <- select_greedy(pairs, "select", "score", threshold = 20) > expect_equal(t$select, c(FALSE, FALSE, FALSE, FALSE, FALSE, FALSE)) > > t <- select_greedy(pairs, "select", "score", threshold = 10) > expect_equal(t$select, c(FALSE, FALSE, TRUE, FALSE, FALSE, FALSE)) > > # Test empty set pairs; regression test > t <- select_greedy(pairs[FALSE,], "select", "score", threshold = 10) > expect_equal(t$select, logical(0)) > > > proc.time() user system elapsed 0.31 0.06 0.37