tests/testthat/test-prp.R

test_that("prp", {
  library(tidyfst)
  library(data.table)
  data.frame(Journal = LETTERS[c(rep(1,9),2)],
             CiteCount = c(rep(1,9),2)) -> journal_table

  expect_equal(
    prp(journal_table,group = "Journal",index = "CiteCount") %>%
      setDF(),
    data.frame(
      stringsAsFactors = FALSE,
      Journal = c("A", "B"),
      total_no = c(9L, 1L),
      prp = c(20, 10)
    )
  )
})

Try the siie package in your browser

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

siie documentation built on Feb. 16, 2023, 10:18 p.m.