Defines functions release_questions .onUnload .onAttach .onLoad

# nocov start
# Set up an environment to cache chars_in_icd10cm
.lookup_chars_in_icd10cm <- new.env(parent = emptyenv())

.onLoad <- function(libname, pkgname) {
  if (.icd_data_dir_okay() && is.null(.get_opt("offline"))) {
    .set_opt(offline = FALSE)
  if (is.null(.get_opt("who_url"))) {
    .set_opt(who_url = "https://icd.who.int/browse10")

.onAttach <- function(libname, pkgname) {
  if (system.file(package = "icd9") != "") {
        "The", sQuote("icd9"), "package is deprecated, and should be removed to",
        "avoid conflicts with ", sQuote("icd"), ". The", sQuote("icd"),
        "package up to version 2.1 contains",
        "tested versions of all the deprecated function names which overlap with",
        "those in the old", sQuote("icd9"), "package, e.g.,",
        sQuote("icd9ComorbidAhrq"), "'. It is",
        "highly recommended to run the command:",
  if (interactive()) {
    if (!.exists_icd_data_dir()) {
        sQuote("icd"), " downloads data when needed. ",
        "set_icd_data_dir() creates a data directory. "
        "Default location is: ", sQuote(.default_icd_data_dir())
    if (system.file(package = "icd.data") != "") {
        "N.b. the ", sQuote("icd.data"),
        " package is deprecated from ",
        sQuote("icd"), " version 4.0. ",
        "The content from ", sQuote("icd.data"),
        " is now available via ", sQuote("icd"), "."

.onUnload <- function(libpath) {
  library.dynam.unload("icd", libpath)

release_questions <- function() {
    "run release_sanity_checks() in tools/extra-tests.R",
    # data
    "clean data then download and update everything on all platforms",
    # documentation:
    "manual render prebuilt efficiency & country-lang-vers vignettes, check correct in the tarball",
    "Do all examples look okay (not just run without errors)?",
    "Consider markdownlint mdl https://github.com/markdownlint/markdownlint",
    "tools/publish.sh and note check for broken links",
    # code quality:
    "Use clang scan-build, with latest version of clang (clang-tools in apt)",
    # testing and compilation and different platforms:
    "Are there any skipped tests which should be run?",
    "MacOS, Windows, Linux, r-hub, win-builder, travis, appveyor",
    "Download and set data dir in vanilla bash and R, Windows, Mac and Linux without library(icd) using icd::download_all_icd_data()",
    # final manual check:
    "Have all unnecessary files been ignored in built source tarball?",
    # post-release
    "Have all the fixed github issues been closed",
    "update version number to devel",
    "make new git branch for devel",
    "pkgdown::build_site() reports no errors"


# nocov end

Try the icd package in your browser

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

icd documentation built on July 2, 2020, 4:07 a.m.