diff --git a/DESCRIPTION b/DESCRIPTION index 0d6a7cba..c1ef4673 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,7 +1,7 @@ Package: TwoSampleMR Title: Two Sample MR Functions and Interface to MRC Integrative Epidemiology Unit OpenGWAS Database -Version: 0.6.28 +Version: 0.6.29 Authors@R: c( person("Gibran", "Hemani", , "g.hemani@bristol.ac.uk", role = c("aut", "cre"), comment = c(ORCID = "0000-0003-0920-1055")), diff --git a/NEWS.md b/NEWS.md index 3902f3d3..a57974d8 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,6 +1,12 @@ # TwoSampleMR v0.6.28 -(Release date 2025-12-15) +(Release date 2025-12-16) + +* Skip two tests if the **MendelianRandomization** package is not installed and protected the running of the perform_mr vignette. + +# TwoSampleMR v0.6.28 + +(Release date 2025-12-16) * Allowed the arguments for `clump_data()` to be specified from `read_exposure_data()` (thanks @al3xjwood). * Fixed two function calls in `mr_moe_single()` diff --git a/tests/testthat/test_otherformats.R b/tests/testthat/test_otherformats.R index c6f9d35c..95b1272a 100644 --- a/tests/testthat/test_otherformats.R +++ b/tests/testthat/test_otherformats.R @@ -6,6 +6,7 @@ load(system.file("extdata", "test_commondata.RData", package = "TwoSampleMR")) test_that("MRInput", { skip_if(getRversion() < '4.4.0') # because MendelianRandomization will not be installed + skip_if_not_installed("MendelianRandomization") w <- dat_to_MRInput(dat, get_correlations = FALSE) expect_true(length(w) == 1) expect_true(class(w) == "list") @@ -18,6 +19,7 @@ test_that("MRInput with cor", { skip_if_offline() skip_if_offline(host = "api.opengwas.io") skip_if(getRversion() < '4.4.0') # because MendelianRandomization will not be installed + skip_if_not_installed("MendelianRandomization") w <- tryCatch( dat_to_MRInput(dat, get_correlations = TRUE)[[1]], error = skip("Server issues"), diff --git a/vignettes/perform_mr.Rmd b/vignettes/perform_mr.Rmd index e07f9d7d..70f672cb 100644 --- a/vignettes/perform_mr.Rmd +++ b/vignettes/perform_mr.Rmd @@ -13,7 +13,7 @@ vignette: > --- ```{r, include=FALSE} -evalinr44 <- getRversion() >= '4.4.0' +evalinr44 <- (getRversion() >= '4.4.0') && requireNamespace("MendelianRandomization", quietly = TRUE) knitr::opts_chunk$set( collapse = TRUE, comment = "#>",