tests/testthat/test_1-0-0_pin.R

context("%pin%")

test_that("%pin% subset of %in%", {
  sstr <- c("c","ab","B","bba","c",NA,"@","bla","a","Ba","%")
  expect_equal(sstr[sstr %pin% "a"],
               c("ab", "bba", "bla", "a", "Ba"))
  expect_equal(sstr[sstr %pin% c("a", "B")],
               c("ab", "B", "bba", "bla", "a", "Ba"))
})

Try the hutils package in your browser

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

hutils documentation built on Aug. 20, 2018, 9:04 a.m.