Skip to content

Commit

Permalink
Merge pull request #432 from RMI-PACTA/release/0.1.4-CRAN-UPDATE
Browse files Browse the repository at this point in the history
Release/0.1.4 cran update
  • Loading branch information
AlexAxthelm authored Nov 7, 2023
2 parents 042cfad + 16c0fef commit 3171a10
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 0 deletions.
2 changes: 2 additions & 0 deletions R/match_name.R
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@
#' @export
#'
#' @examples
#' \dontrun{
#' library(r2dii.data)
#' library(tibble)
#'
Expand Down Expand Up @@ -102,6 +103,7 @@
#'
#' # Cleanup
#' options(restore)
#' }
match_name <- function(loanbook,
abcd,
by_sector = TRUE,
Expand Down
10 changes: 10 additions & 0 deletions R/r2dii.match-package.R
Original file line number Diff line number Diff line change
@@ -1,6 +1,16 @@
#' @keywords internal
"_PACKAGE"


.onLoad <- function(libname, pkgname) {
# CRAN OMP THREAD LIMIT
# logic for setting OMP_THREAD_LIMIT form https://stackoverflow.com/a/77323812
# check modified from testthat's on_cran function
if (!interactive() && isFALSE(as.logical(Sys.getenv("NOT_CRAN", "false")))) {
Sys.setenv("OMP_THREAD_LIMIT" = 2)
}
}

# The following block is used by usethis to automatically manage
# roxygen namespace tags. Modify with care!
## usethis namespace: start
Expand Down
2 changes: 2 additions & 0 deletions man/match_name.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions tests/testthat/test-match_name.R
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
library(dplyr, warn.conflicts = FALSE)
library(r2dii.data)


test_that("w/ non-NA only at intermediate level yields matches at intermediate
level only", {
lbk <- tibble::tibble(
Expand All @@ -26,6 +27,8 @@ test_that("w/ non-NA only at intermediate level yields matches at intermediate
expect_equal(out$level, "intermediate_parent_999")
})

skip_on_cran()

test_that("w/ missing values at all levels outputs 0-row", {
lbk <- tibble(
id_direct_loantaker = NA_character_,
Expand Down

0 comments on commit 3171a10

Please sign in to comment.