tests/testthat/setup_round_5.R

# rounding functions to allow testthat snapshotting to work

round_5_xs <- function(x) {
  lapply(x, round, 5)
}

round_5_xss <- function(x) {
  lapply(x, function(y) { lapply(y, round, 5) })
}


round_numeric_df <- function(x) {
  numeric_cols <- sapply(x, is.numeric)
  x[numeric_cols] <- round(x[numeric_cols], 5)
  x
}

round_list_of_dfs <- function(x) {
  lapply(x, function(y) {
    round_numeric_df(y)
  })
}

Try the mortAAR package in your browser

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

mortAAR documentation built on Aug. 28, 2023, 1:06 a.m.