tests/testthat/test-prcn.R

context("sjmisc, prcn")

library(sjmisc)

test_that("prcn", {
  expect_equal(prcn(0.2389), "23.89%")
})

test_that("prcn", {
  expect_equal(prcn(c(0.2143887, 0.55443, 0.12345)), c("21.44%", "55.44%", "12.35%"))
})

Try the sjmisc package in your browser

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

sjmisc documentation built on Sept. 24, 2019, 5:04 p.m.