tests/testthat/test_select_which.R

library(data.table)
DT <- data.table(xyz = 1:5,
                 abc = 1:5 + 0,
                 ab = as.raw(1:5),
                 cdf = letters[1:5])
expect_equal(select_which(DT, is.integer, .and.grep = "^a"),
             DT[, .(xyz, abc, ab)])

Try the hutils package in your browser

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

hutils documentation built on April 13, 2022, 5:23 p.m.