tests/testthat/test_isSAME.R

x <- c(
  "SAME",
  " SAME ",
  "SAME(1)",
  "SAME (1)",
  "  SAME   (  123 ) ",
  "SAME()",
  "SAME (a)",
  "NOT SAME"
)

context("isSAME")



test_that("basic",{
  

res <- isSAME(x)

expect_equal(res,
             c(TRUE,TRUE,TRUE,TRUE,TRUE,FALSE,FALSE,FALSE)
             )

})


context("NSAME")

test_that("basic",{
  res <- NSAME(x)

expect_equal(res,
             c(1,1,1,1,123,NA,NA,NA)
             )

})

Try the NMdata package in your browser

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

NMdata documentation built on June 17, 2026, 9:06 a.m.