From c5f72943810086c8491585458a9ed80d97959666 Mon Sep 17 00:00:00 2001 From: "Matthijs S. Berends" Date: Fri, 31 Jul 2020 10:50:08 +0200 Subject: [PATCH] (v1.3.0) skip more CRAN tests --- .Rbuildignore | 6 +----- DESCRIPTION | 2 +- R/ab_class_selectors.R | 3 ++- R/ab_from_text.R | 2 +- R/filter_ab_class.R | 5 ++--- R/ggplot_pca.R | 3 ++- R/resistance_predict.R | 4 +++- cran-comments.md | 2 +- docs/pkgdown.yml | 2 +- docs/reference/ab_from_text.html | 2 +- .../reference/antibiotic_class_selectors.html | 3 ++- docs/reference/filter_ab_class.html | 5 ++--- docs/reference/ggplot_pca.html | 3 ++- docs/reference/resistance_predict.html | 4 +++- man/ab_from_text.Rd | 2 +- man/antibiotic_class_selectors.Rd | 3 ++- man/filter_ab_class.Rd | 5 ++--- man/ggplot_pca.Rd | 3 ++- man/resistance_predict.Rd | 4 +++- tests/testthat/test-ab.R | 1 - tests/testthat/test-ab_from_text.R | 1 - tests/testthat/test-ab_property.R | 1 - tests/testthat/test-age.R | 2 ++ tests/testthat/test-availability.R | 1 + tests/testthat/test-bug_drug_combinations.R | 1 - tests/testthat/test-count.R | 1 - tests/testthat/test-data.R | 20 +++++++++++-------- tests/testthat/test-deprecated.R | 1 + tests/testthat/test-disk.R | 1 + tests/testthat/test-first_isolate.R | 1 - tests/testthat/test-g.test.R | 1 + tests/testthat/test-get_locale.R | 1 + tests/testthat/test-ggplot_rsi.R | 2 +- tests/testthat/test-guess_ab_col.R | 1 + tests/testthat/test-join_microorganisms.R | 1 + tests/testthat/test-key_antibiotics.R | 1 + tests/testthat/test-kurtosis.R | 1 + tests/testthat/test-like.R | 1 + tests/testthat/test-mic.R | 1 + tests/testthat/test-misc.R | 3 +++ tests/testthat/test-mo_history.R | 20 ------------------- tests/testthat/test-p_symbol.R | 1 + tests/testthat/test-resistance_predict.R | 1 + tests/testthat/test-rsi.R | 1 - tests/testthat/test-skewness.R | 1 + 45 files changed, 66 insertions(+), 65 deletions(-) delete mode 100644 tests/testthat/test-mo_history.R diff --git a/.Rbuildignore b/.Rbuildignore index 3f0c01c7..b1c2ef1a 100755 --- a/.Rbuildignore +++ b/.Rbuildignore @@ -1,6 +1,4 @@ ^.*\.Rproj$ -^\.gitlab-ci\.R$ -^\.gitlab-ci\.yml$ ^\.Renviron$ ^\.Rprofile$ ^\.Rproj\.user$ @@ -23,6 +21,4 @@ ^public$ ^data-raw$ ^\.lintr$ -^vignettes/benchmark.* -^vignettes/SPSS.* -^tests/appveyor$ +^vignettes$ diff --git a/DESCRIPTION b/DESCRIPTION index 5a0ed1ae..8ad67e4e 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: AMR Version: 1.3.0 -Date: 2020-07-30 +Date: 2020-07-31 Title: Antimicrobial Resistance Analysis Authors@R: c( person(role = c("aut", "cre"), diff --git a/R/ab_class_selectors.R b/R/ab_class_selectors.R index eb6c46c8..bd359265 100644 --- a/R/ab_class_selectors.R +++ b/R/ab_class_selectors.R @@ -31,7 +31,8 @@ #' @name antibiotic_class_selectors #' @export #' @examples -#' if (require("dplyr")) { +#' \dontrun{ +#' library(dplyr) #' #' # this will select columns 'IPM' (imipenem) and 'MEM' (meropenem): #' example_isolates %>% diff --git a/R/ab_from_text.R b/R/ab_from_text.R index bb34451a..c360c203 100644 --- a/R/ab_from_text.R +++ b/R/ab_from_text.R @@ -64,7 +64,7 @@ #' abx <- ab_from_text("500 mg amoxi po and 400mg cipro iv") #' ab_group(abx[[1]]) #' -#' if (require(dplyr)) { +#' if (require("dplyr")) { #' tibble(clinical_text = c("given 400mg cipro and 500 mg amox", #' "started on doxy iv today")) %>% #' mutate(abx_codes = ab_from_text(clinical_text), diff --git a/R/filter_ab_class.R b/R/filter_ab_class.R index 165814b0..2249697e 100644 --- a/R/filter_ab_class.R +++ b/R/filter_ab_class.R @@ -33,7 +33,8 @@ #' @seealso [antibiotic_class_selectors()] for the `select()` equivalent. #' @export #' @examples -#' if (require(dplyr)) { +#' \dontrun{ +#' library(dplyr) #' #' # filter on isolates that have any result for any aminoglycoside #' example_isolates %>% filter_ab_class("aminoglycoside") @@ -62,9 +63,7 @@ #' example_isolates %>% #' filter_aminoglycosides("R", "all") %>% #' filter_fluoroquinolones("R", "all") -#' } #' -#' \dontrun{ #' # with dplyr 1.0.0 and higher (that adds 'across()'), this is equal: #' example_isolates %>% filter_carbapenems("R", "all") #' example_isolates %>% filter(across(carbapenems(), ~. == "R")) diff --git a/R/ggplot_pca.R b/R/ggplot_pca.R index ad4a6f82..e81f18e8 100755 --- a/R/ggplot_pca.R +++ b/R/ggplot_pca.R @@ -60,7 +60,8 @@ #' # See ?example_isolates. #' #' # See ?pca for more info about Principal Component Analysis (PCA). -#' if (require("dplyr")) { +#' \dontrun{ +#' library(dplyr) #' pca_model <- example_isolates %>% #' filter(mo_genus(mo) == "Staphylococcus") %>% #' group_by(species = mo_shortname(mo)) %>% diff --git a/R/resistance_predict.R b/R/resistance_predict.R index 04b05fcc..c2148761 100755 --- a/R/resistance_predict.R +++ b/R/resistance_predict.R @@ -84,7 +84,9 @@ #' } #' #' # create nice plots with ggplot2 yourself -#' if (require(ggplot2) & require("dplyr")) { +#' \dontrun{ +#' library(dplyr) +#' library(ggplot2) #' #' data <- example_isolates %>% #' filter(mo == as.mo("E. coli")) %>% diff --git a/cran-comments.md b/cran-comments.md index 8b4439e1..8b1a2ce1 100644 --- a/cran-comments.md +++ b/cran-comments.md @@ -1,3 +1,3 @@ -* For this specific version, nothing to mention. +* Edited the unit tests, so they will run under 10 minutes on CRAN (using testthat::skip_on_cran() on some tests). * Since version 0.3.0 (2018-08-14), CHECK returns a NOTE for having a data directory over 3 MB. This is needed to offer users reference data for the complete taxonomy of microorganisms - one of the most important features of this package. diff --git a/docs/pkgdown.yml b/docs/pkgdown.yml index e55e1ab2..f5473010 100644 --- a/docs/pkgdown.yml +++ b/docs/pkgdown.yml @@ -10,7 +10,7 @@ articles: WHONET: WHONET.html benchmarks: benchmarks.html resistance_predict: resistance_predict.html -last_built: 2020-07-30T13:15Z +last_built: 2020-07-31T08:49Z urls: reference: https://msberends.github.io/AMR/reference article: https://msberends.github.io/AMR/articles diff --git a/docs/reference/ab_from_text.html b/docs/reference/ab_from_text.html index c1dbf2c0..f68c2870 100644 --- a/docs/reference/ab_from_text.html +++ b/docs/reference/ab_from_text.html @@ -321,7 +321,7 @@ The lifecycle of this function is maturing< abx <- ab_from_text("500 mg amoxi po and 400mg cipro iv") ab_group(abx[[1]]) -if (require(dplyr)) { +if (require("dplyr")) { tibble(clinical_text = c("given 400mg cipro and 500 mg amox", "started on doxy iv today")) %>% mutate(abx_codes = ab_from_text(clinical_text), diff --git a/docs/reference/antibiotic_class_selectors.html b/docs/reference/antibiotic_class_selectors.html index 73ddbd40..a11a7225 100644 --- a/docs/reference/antibiotic_class_selectors.html +++ b/docs/reference/antibiotic_class_selectors.html @@ -281,7 +281,8 @@

filter_ab_class() for the filter() equivalent.

Examples

-
if (require("dplyr")) {
+    
if (FALSE) {
+  library(dplyr)
 
   # this will select columns 'IPM' (imipenem) and 'MEM' (meropenem):
   example_isolates %>%
diff --git a/docs/reference/filter_ab_class.html b/docs/reference/filter_ab_class.html
index 18c5fe1f..7659109f 100644
--- a/docs/reference/filter_ab_class.html
+++ b/docs/reference/filter_ab_class.html
@@ -303,7 +303,8 @@ The lifecycle of this function is stable

antibiotic_class_selectors() for the select() equivalent.

Examples

-
if (require(dplyr)) {
+    
if (FALSE) {
+library(dplyr)
 
 # filter on isolates that have any result for any aminoglycoside
 example_isolates %>% filter_ab_class("aminoglycoside")
@@ -332,9 +333,7 @@ The lifecycle of this function is stableexample_isolates %>%
   filter_aminoglycosides("R", "all") %>%
   filter_fluoroquinolones("R", "all")
-}
 
-if (FALSE) {
 # with dplyr 1.0.0 and higher (that adds 'across()'), this is equal:
 example_isolates %>% filter_carbapenems("R", "all")
 example_isolates %>% filter(across(carbapenems(), ~. == "R"))
diff --git a/docs/reference/ggplot_pca.html b/docs/reference/ggplot_pca.html
index 6281548c..65b1d481 100644
--- a/docs/reference/ggplot_pca.html
+++ b/docs/reference/ggplot_pca.html
@@ -388,7 +388,8 @@ The lifecycle of this function is maturing<
 # See ?example_isolates.
 
 # See ?pca for more info about Principal Component Analysis (PCA).
-if (require("dplyr")) {
+if (FALSE) {
+  library(dplyr)
   pca_model <- example_isolates %>%
     filter(mo_genus(mo) == "Staphylococcus") %>%
     group_by(species = mo_shortname(mo)) %>%
diff --git a/docs/reference/resistance_predict.html b/docs/reference/resistance_predict.html
index 8528eb4a..dcd0ebc7 100644
--- a/docs/reference/resistance_predict.html
+++ b/docs/reference/resistance_predict.html
@@ -411,7 +411,9 @@ A microorganism is categorised as Susceptible, Increased exposure when
 }
 
 # create nice plots with ggplot2 yourself
-if (require(ggplot2) & require("dplyr")) {
+if (FALSE) {
+  library(dplyr)
+  library(ggplot2)
 
   data <- example_isolates %>%
     filter(mo == as.mo("E. coli")) %>%
diff --git a/man/ab_from_text.Rd b/man/ab_from_text.Rd
index 4ca3413c..569c01af 100644
--- a/man/ab_from_text.Rd
+++ b/man/ab_from_text.Rd
@@ -80,7 +80,7 @@ ab_from_text("500 mg amoxi po and 400mg cipro iv", collapse = ", ")
 abx <- ab_from_text("500 mg amoxi po and 400mg cipro iv")
 ab_group(abx[[1]])
 
-if (require(dplyr)) {
+if (require("dplyr")) {
   tibble(clinical_text = c("given 400mg cipro and 500 mg amox",
                            "started on doxy iv today")) \%>\% 
     mutate(abx_codes = ab_from_text(clinical_text),
diff --git a/man/antibiotic_class_selectors.Rd b/man/antibiotic_class_selectors.Rd
index 9317fa1a..be67d356 100644
--- a/man/antibiotic_class_selectors.Rd
+++ b/man/antibiotic_class_selectors.Rd
@@ -58,7 +58,8 @@ All columns will be searched for known antibiotic names, abbreviations, brand na
 These functions only work if the \code{tidyselect} package is installed, that comes with the \code{dplyr} package. An error will be thrown if \code{tidyselect} package is not installed, or if the functions are used outside a function that allows Tidyverse selections like \code{select()} or \code{pivot_longer()}.
 }
 \examples{
-if (require("dplyr")) {
+\dontrun{
+  library(dplyr)
 
   # this will select columns 'IPM' (imipenem) and 'MEM' (meropenem):
   example_isolates \%>\% 
diff --git a/man/filter_ab_class.Rd b/man/filter_ab_class.Rd
index 96dcd603..51cc0e85 100644
--- a/man/filter_ab_class.Rd
+++ b/man/filter_ab_class.Rd
@@ -71,7 +71,8 @@ If the unlying code needs breaking changes, they will occur gradually. For examp
 }
 
 \examples{
-if (require(dplyr)) {
+\dontrun{
+library(dplyr)
 
 # filter on isolates that have any result for any aminoglycoside
 example_isolates \%>\% filter_ab_class("aminoglycoside")
@@ -100,9 +101,7 @@ example_isolates \%>\%
 example_isolates \%>\%
   filter_aminoglycosides("R", "all") \%>\%
   filter_fluoroquinolones("R", "all")
-}
 
-\dontrun{
 # with dplyr 1.0.0 and higher (that adds 'across()'), this is equal:
 example_isolates \%>\% filter_carbapenems("R", "all")
 example_isolates \%>\% filter(across(carbapenems(), ~. == "R"))
diff --git a/man/ggplot_pca.Rd b/man/ggplot_pca.Rd
index a822f2c6..15f98a40 100644
--- a/man/ggplot_pca.Rd
+++ b/man/ggplot_pca.Rd
@@ -118,7 +118,8 @@ The \link[=lifecycle]{lifecycle} of this function is \strong{maturing}. The unly
 # See ?example_isolates.
 
 # See ?pca for more info about Principal Component Analysis (PCA).
-if (require("dplyr")) {
+\dontrun{
+  library(dplyr)
   pca_model <- example_isolates \%>\% 
     filter(mo_genus(mo) == "Staphylococcus") \%>\% 
     group_by(species = mo_shortname(mo)) \%>\%
diff --git a/man/resistance_predict.Rd b/man/resistance_predict.Rd
index 8fffc0b0..beb368bb 100644
--- a/man/resistance_predict.Rd
+++ b/man/resistance_predict.Rd
@@ -150,7 +150,9 @@ if (require("dplyr")) {
 }
 
 # create nice plots with ggplot2 yourself
-if (require(ggplot2) & require("dplyr")) {
+\dontrun{
+  library(dplyr)
+  library(ggplot2)
 
   data <- example_isolates \%>\%
     filter(mo == as.mo("E. coli")) \%>\%
diff --git a/tests/testthat/test-ab.R b/tests/testthat/test-ab.R
index 18fa49dc..a3ce9556 100755
--- a/tests/testthat/test-ab.R
+++ b/tests/testthat/test-ab.R
@@ -22,7 +22,6 @@
 context("ab.R")
 
 test_that("as.ab works", {
-  
   skip_on_cran()
   
   expect_equal(as.character(as.ab(c("J01FA01",
diff --git a/tests/testthat/test-ab_from_text.R b/tests/testthat/test-ab_from_text.R
index eefc472c..17c11c5d 100644
--- a/tests/testthat/test-ab_from_text.R
+++ b/tests/testthat/test-ab_from_text.R
@@ -22,7 +22,6 @@
 context("ab_from_text.R")
 
 test_that("ab_from_text works", {
-  
   skip_on_cran()
   
   expect_identical(ab_from_text("28/03/2020 regular amoxicilliin 500mg po tds")[[1]],
diff --git a/tests/testthat/test-ab_property.R b/tests/testthat/test-ab_property.R
index 91a39d0f..bbe425f0 100644
--- a/tests/testthat/test-ab_property.R
+++ b/tests/testthat/test-ab_property.R
@@ -22,7 +22,6 @@
 context("ab_property.R")
 
 test_that("ab_property works", {
-  
   skip_on_cran()
   
   expect_identical(ab_name("AMX"), "Amoxicillin")
diff --git a/tests/testthat/test-age.R b/tests/testthat/test-age.R
index d0f7341a..167a83a8 100644
--- a/tests/testthat/test-age.R
+++ b/tests/testthat/test-age.R
@@ -22,6 +22,7 @@
 context("age.R")
 
 test_that("age works", {
+  skip_on_cran()
   expect_equal(age(x = c("1980-01-01", "1985-01-01", "1990-01-01"),
                    reference = "2019-01-01"),
                c(39, 34, 29))
@@ -47,6 +48,7 @@ test_that("age works", {
 })
 
 test_that("age_groups works", {
+  skip_on_cran()
   ages <- c(3, 8, 16, 54, 31, 76, 101, 43, 21)
 
   expect_equal(length(unique(age_groups(ages, 50))),
diff --git a/tests/testthat/test-availability.R b/tests/testthat/test-availability.R
index ec45fd97..134c4b95 100644
--- a/tests/testthat/test-availability.R
+++ b/tests/testthat/test-availability.R
@@ -22,5 +22,6 @@
 context("availability.R")
 
 test_that("availability works", {
+  skip_on_cran()
   expect_equal(class(availability(example_isolates)), "data.frame")
 })
diff --git a/tests/testthat/test-bug_drug_combinations.R b/tests/testthat/test-bug_drug_combinations.R
index 3cfdfa6b..3dd5dbd9 100644
--- a/tests/testthat/test-bug_drug_combinations.R
+++ b/tests/testthat/test-bug_drug_combinations.R
@@ -22,7 +22,6 @@
 context("bug_drug_combinations.R")
 
 test_that("bug_drug_combinations works", {
-  
   skip_on_cran()
   
   b <- suppressWarnings(bug_drug_combinations(example_isolates))
diff --git a/tests/testthat/test-count.R b/tests/testthat/test-count.R
index 9dbfa6f4..02ae9173 100644
--- a/tests/testthat/test-count.R
+++ b/tests/testthat/test-count.R
@@ -22,7 +22,6 @@
 context("count.R")
 
 test_that("counts work", {
-  
   skip_on_cran()
   
   expect_equal(count_resistant(example_isolates$AMX), count_R(example_isolates$AMX))
diff --git a/tests/testthat/test-data.R b/tests/testthat/test-data.R
index 3f01a127..f2a0dbb0 100644
--- a/tests/testthat/test-data.R
+++ b/tests/testthat/test-data.R
@@ -22,7 +22,7 @@
 context("data.R")
 
 test_that("data sets are valid", {
-  
+  skip_on_cran()
   expect_true(check_dataset_integrity()) # in misc.R
   
   # IDs should always be unique
@@ -39,10 +39,10 @@ test_that("data sets are valid", {
   expect_false(any(is.na(microorganisms.codes$code)))
   expect_false(any(is.na(microorganisms.codes$mo)))
   expect_false(any(microorganisms.translation$mo_old %in% microorganisms$mo))
-
+  
   # antibiotic names must always be coercible to their original AB code
   expect_identical(antibiotics$ab, as.ab(antibiotics$name))
-
+  
   # there should be no diacritics (i.e. non ASCII) characters in the datasets (CRAN policy)
   datasets <- data(package = "AMR", envir = asNamespace("AMR"))$results[, "Item"]
   for (i in seq_len(length(datasets))) {
@@ -52,6 +52,8 @@ test_that("data sets are valid", {
 })
 
 test_that("creation of data sets is valid", {
+  skip_on_cran()
+  
   df <- create_MO_lookup()
   expect_lt(nrow(df[which(df$prevalence == 1), ]), nrow(df[which(df$prevalence == 2), ]))
   expect_lt(nrow(df[which(df$prevalence == 2), ]), nrow(df[which(df$prevalence == 3), ]))
@@ -59,16 +61,18 @@ test_that("creation of data sets is valid", {
                     "kingdom", "phylum", "class", "order", "family", "genus", "species", "subspecies",
                     "rank", "ref", "species_id", "source", "prevalence", "snomed",
                     "kingdom_index", "fullname_lower", "g_species") %in% colnames(df)))
-
+  
   olddf <- create_MO.old_lookup()
   expect_true(all(c("fullname", "fullname_new", "ref", "prevalence",
                     "fullname_lower", "g_species") %in% colnames(olddf)))
-
+  
 })
 
 test_that("CoL version info works", {
- expect_identical(class(catalogue_of_life_version()),
-                  c("catalogue_of_life_version", "list"))
-
+  skip_on_cran()
+  
+  expect_identical(class(catalogue_of_life_version()),
+                   c("catalogue_of_life_version", "list"))
+  
   expect_output(print(catalogue_of_life_version()))
 })
diff --git a/tests/testthat/test-deprecated.R b/tests/testthat/test-deprecated.R
index 5fdd2d36..992ec8d5 100644
--- a/tests/testthat/test-deprecated.R
+++ b/tests/testthat/test-deprecated.R
@@ -22,6 +22,7 @@
 context("deprecated.R")
 
 test_that("deprecated functions work", {
+  skip_on_cran()
   expect_equal(suppressWarnings(portion_S(example_isolates$AMX)), proportion_S(example_isolates$AMX))
   expect_equal(suppressWarnings(portion_SI(example_isolates$AMX)), proportion_SI(example_isolates$AMX))
   expect_equal(suppressWarnings(portion_I(example_isolates$AMX)), proportion_I(example_isolates$AMX))
diff --git a/tests/testthat/test-disk.R b/tests/testthat/test-disk.R
index 9c7d6461..48246e23 100755
--- a/tests/testthat/test-disk.R
+++ b/tests/testthat/test-disk.R
@@ -22,6 +22,7 @@
 context("disk.R")
 
 test_that("disk works", {
+  skip_on_cran()
   expect_true(as.disk(8) == as.disk("8"))
   expect_true(is.disk(as.disk(8)))
 
diff --git a/tests/testthat/test-first_isolate.R b/tests/testthat/test-first_isolate.R
index 08270d69..292ce7e2 100755
--- a/tests/testthat/test-first_isolate.R
+++ b/tests/testthat/test-first_isolate.R
@@ -22,7 +22,6 @@
 context("first_isolate.R")
 
 test_that("first isolates work", {
-  
   skip_on_cran()
   
   # first isolates
diff --git a/tests/testthat/test-g.test.R b/tests/testthat/test-g.test.R
index 35fc17fa..06a6d7e4 100644
--- a/tests/testthat/test-g.test.R
+++ b/tests/testthat/test-g.test.R
@@ -22,6 +22,7 @@
 context("g.test.R")
 
 test_that("G-test works", {
+  skip_on_cran()
 
   # GOODNESS-OF-FIT
 
diff --git a/tests/testthat/test-get_locale.R b/tests/testthat/test-get_locale.R
index 9180fdfe..e98fa2fb 100644
--- a/tests/testthat/test-get_locale.R
+++ b/tests/testthat/test-get_locale.R
@@ -22,6 +22,7 @@
 context("get_locale.R")
 
 test_that("get_locale works", {
+  skip_on_cran()
   expect_identical(mo_genus("B_GRAMP", language = "pt"),
                    "(Gram positivos desconhecidos)")
 
diff --git a/tests/testthat/test-ggplot_rsi.R b/tests/testthat/test-ggplot_rsi.R
index 7298e203..6214098d 100644
--- a/tests/testthat/test-ggplot_rsi.R
+++ b/tests/testthat/test-ggplot_rsi.R
@@ -25,7 +25,7 @@ test_that("ggplot_rsi works", {
 
   skip_on_cran()
   
-  skip_if_not("ggplot2" %in% rownames(installed.packages()))
+  skip_if_not_installed("ggplot2")
 
   library(dplyr)
   library(ggplot2)
diff --git a/tests/testthat/test-guess_ab_col.R b/tests/testthat/test-guess_ab_col.R
index d1d59b02..cfbe6606 100644
--- a/tests/testthat/test-guess_ab_col.R
+++ b/tests/testthat/test-guess_ab_col.R
@@ -22,6 +22,7 @@
 context("guess_ab_col.R")
 
 test_that("guess_ab_col works", {
+  skip_on_cran()
 
   expect_equal(guess_ab_col(example_isolates, "amox"),
                "AMX")
diff --git a/tests/testthat/test-join_microorganisms.R b/tests/testthat/test-join_microorganisms.R
index eeef5bbe..bdda1c62 100755
--- a/tests/testthat/test-join_microorganisms.R
+++ b/tests/testthat/test-join_microorganisms.R
@@ -22,6 +22,7 @@
 context("join_microorganisms.R")
 
 test_that("joins work", {
+  skip_on_cran()
   unjoined <- example_isolates
   inner <- example_isolates %>% inner_join_microorganisms()
   left <- example_isolates %>% left_join_microorganisms()
diff --git a/tests/testthat/test-key_antibiotics.R b/tests/testthat/test-key_antibiotics.R
index 463aea5e..578772e7 100644
--- a/tests/testthat/test-key_antibiotics.R
+++ b/tests/testthat/test-key_antibiotics.R
@@ -22,6 +22,7 @@
 context("key_antibiotics.R")
 
 test_that("keyantibiotics work", {
+  skip_on_cran()
   expect_equal(length(key_antibiotics(example_isolates, warnings = FALSE)), nrow(example_isolates))
   expect_false(all(is.na(key_antibiotics(example_isolates))))
   expect_true(key_antibiotics_equal("SSS", "SSS"))
diff --git a/tests/testthat/test-kurtosis.R b/tests/testthat/test-kurtosis.R
index bb3fd3b9..ebf824ca 100644
--- a/tests/testthat/test-kurtosis.R
+++ b/tests/testthat/test-kurtosis.R
@@ -22,6 +22,7 @@
 context("kurtosis.R")
 
 test_that("kurtosis works", {
+  skip_on_cran()
   expect_equal(kurtosis(example_isolates$age),
                3.549319,
                tolerance = 0.00001)
diff --git a/tests/testthat/test-like.R b/tests/testthat/test-like.R
index 7adee61b..1c85033f 100644
--- a/tests/testthat/test-like.R
+++ b/tests/testthat/test-like.R
@@ -22,6 +22,7 @@
 context("like.R")
 
 test_that("`like` works", {
+  skip_on_cran()
   expect_true(sum("test" %like% c("^t", "^s")) == 1)
   expect_true("test" %like% "test")
   expect_true("test" %like% "TEST")
diff --git a/tests/testthat/test-mic.R b/tests/testthat/test-mic.R
index d9045e84..9b0fac82 100755
--- a/tests/testthat/test-mic.R
+++ b/tests/testthat/test-mic.R
@@ -22,6 +22,7 @@
 context("mic.R")
 
 test_that("mic works", {
+  skip_on_cran()
   expect_true(as.mic(8) == as.mic("8"))
   expect_true(as.mic("1") > as.mic("<=0.0625"))
   expect_true(as.mic("1") < as.mic(">=32"))
diff --git a/tests/testthat/test-misc.R b/tests/testthat/test-misc.R
index 62fa1557..c425a501 100755
--- a/tests/testthat/test-misc.R
+++ b/tests/testthat/test-misc.R
@@ -22,6 +22,7 @@
 context("misc.R")
 
 test_that("percentages works", {
+  skip_on_cran()
   expect_equal(percentage(0.25), "25%")
   expect_equal(percentage(0.5), "50%")
   expect_equal(percentage(0.500, digits = 1), "50.0%")
@@ -32,6 +33,7 @@ test_that("percentages works", {
 })
 
 test_that("functions missing in older R versions work", {
+  skip_on_cran()
   expect_equal(strrep("A", 5), "AAAAA")
   expect_equal(strrep(c("A", "B"), c(5, 2)), c("AAAAA", "BB"))
   expect_equal(trimws(" test "), "test")
@@ -40,6 +42,7 @@ test_that("functions missing in older R versions work", {
 })
 
 test_that("looking up ab columns works", {
+  skip_on_cran()
   expect_warning(generate_warning_abs_missing(c("AMP", "AMX")))
   expect_warning(generate_warning_abs_missing(c("AMP", "AMX"), any = TRUE))
   expect_warning(get_column_abx(example_isolates, hard_dependencies = "FUS"))
diff --git a/tests/testthat/test-mo_history.R b/tests/testthat/test-mo_history.R
deleted file mode 100644
index 4b7b04a0..00000000
--- a/tests/testthat/test-mo_history.R
+++ /dev/null
@@ -1,20 +0,0 @@
-# ==================================================================== #
-# TITLE                                                                #
-# Antimicrobial Resistance (AMR) Analysis                              #
-#                                                                      #
-# SOURCE                                                               #
-# https://github.com/msberends/AMR                                     #
-#                                                                      #
-# LICENCE                                                              #
-# (c) 2018-2020 Berends MS, Luz CF et al.                              #
-#                                                                      #
-# This R package is free software; you can freely use and distribute   #
-# it for both personal and commercial purposes under the terms of the  #
-# GNU General Public License version 2.0 (GNU GPL-2), as published by  #
-# the Free Software Foundation.                                        #
-#                                                                      #
-# We created this package for both routine data analysis and academic  #
-# research and it was publicly released in the hope that it will be    #
-# useful, but it comes WITHOUT ANY WARRANTY OR LIABILITY.              #
-# Visit our website for more info: https://msberends.github.io/AMR.    #
-# ==================================================================== #
diff --git a/tests/testthat/test-p_symbol.R b/tests/testthat/test-p_symbol.R
index 7fdcba53..179b6419 100644
--- a/tests/testthat/test-p_symbol.R
+++ b/tests/testthat/test-p_symbol.R
@@ -22,6 +22,7 @@
 context("p_symbol.R")
 
 test_that("P symbol works", {
+  skip_on_cran()
   expect_identical(p_symbol(c(0.001, 0.01, 0.05, 0.1, 1, NA, 3)),
                    c("***", "**", "*", ".", " ", NA, NA))
 })
diff --git a/tests/testthat/test-resistance_predict.R b/tests/testthat/test-resistance_predict.R
index fd8f2aaf..e66df7af 100644
--- a/tests/testthat/test-resistance_predict.R
+++ b/tests/testthat/test-resistance_predict.R
@@ -22,6 +22,7 @@
 context("resistance_predict.R")
 
 test_that("prediction of rsi works", {
+  skip_on_cran()
   AMX_R <- example_isolates %>%
     filter(mo == "B_ESCHR_COLI") %>%
     rsi_predict(col_ab = "AMX",
diff --git a/tests/testthat/test-rsi.R b/tests/testthat/test-rsi.R
index eaa6a368..11ac1143 100644
--- a/tests/testthat/test-rsi.R
+++ b/tests/testthat/test-rsi.R
@@ -22,7 +22,6 @@
 context("rsi.R")
 
 test_that("rsi works", {
-  
   skip_on_cran()
   
   expect_true(as.rsi("S") < as.rsi("I"))
diff --git a/tests/testthat/test-skewness.R b/tests/testthat/test-skewness.R
index ad7e413b..2e986840 100644
--- a/tests/testthat/test-skewness.R
+++ b/tests/testthat/test-skewness.R
@@ -22,6 +22,7 @@
 context("skewness.R")
 
 test_that("skewness works", {
+  skip_on_cran()
   expect_equal(skewness(example_isolates$age),
                -0.8958019,
                tolerance = 0.00001)