diff --git a/DESCRIPTION b/DESCRIPTION index 9825acaf..a99b33ac 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,7 +1,7 @@ Package: secuTrialR Type: Package Title: Handling of Data from the Clinical Data Management System 'secuTrial' -Version: 1.1.0 +Version: 1.1.1 Authors@R: c(person(given = "Alan G.", family = "Haynes", diff --git a/NEWS.md b/NEWS.md index 6eeebb49..15a25a86 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,3 +1,6 @@ +# secuTrialR 1.1.1 +* fix CRAN notes - remove codecov badge, check class via inherits + # secuTrialR 1.1.0 * warning regarding overwritten `pat_id` variable diff --git a/R/annual_recruitment.R b/R/annual_recruitment.R index 3df4fda2..93d85ce7 100644 --- a/R/annual_recruitment.R +++ b/R/annual_recruitment.R @@ -29,7 +29,7 @@ #' annual_recruitment(sT_export, rm_regex = "\\(.*\\)$") #' annual_recruitment <- function(x, rm_regex = "") { - if (class(x) == "secuTrialdata") { + if (inherits(x, "secuTrialdata")) { # wrap plot_recruitment to retrieve data recruitment_data <- plot_recruitment(x, return_data = TRUE) # construct header diff --git a/R/check_export_options.R b/R/check_export_options.R index a45f2f04..28a6ab39 100644 --- a/R/check_export_options.R +++ b/R/check_export_options.R @@ -28,7 +28,7 @@ #' #' secuTrialR:::check_export_options(sT_export) check_export_options <- function(dat) { - if (class(dat) != "secuTrialdata") { + if (!inherits(dat, "secuTrialdata")) { stop("check_export_options requires objects of the class 'secuTrialdata' as input.") } eo <- dat$export_options diff --git a/R/diff_secuTrial.R b/R/diff_secuTrial.R index 3b2778ee..e08b5636 100644 --- a/R/diff_secuTrial.R +++ b/R/diff_secuTrial.R @@ -31,7 +31,7 @@ #' diff_secuTrial(ctu06_v1, ctu06_v2) #' diff_secuTrial <- function(x, y) { - if (class(x) == "secuTrialdata" & class(y) == "secuTrialdata") { + if (inherits(x, "secuTrialdata") & inherits(y, "secuTrialdata")) { # comparisons are only possible if the project setup was exported if (! x$export_options$proj_setup & y$export_options$proj_setup) { diff --git a/R/get.R b/R/get.R index 4546c80d..0575e831 100644 --- a/R/get.R +++ b/R/get.R @@ -20,7 +20,7 @@ #' participants <- get_participants(sT_export) #' get_participants <- function(dat) { - if (class(dat) != "secuTrialdata") { + if (!inherits(dat, "secuTrialdata")) { stop("get_participants requires objects of the class 'secuTrialdata' as input.") } diff --git a/R/links_secuTrial.R b/R/links_secuTrial.R index aefbbe75..6d61b0dd 100644 --- a/R/links_secuTrial.R +++ b/R/links_secuTrial.R @@ -38,7 +38,7 @@ #' links_secuTrial(sT_export, forms = "^ctu05") #' } links_secuTrial <- function(object, forms = NULL, formcol = "#d8b365", varcol = "#e5f5f9", plot = TRUE) { - if (!class(object) == "secuTrialdata") stop("object of class secuTrialdata expected") + if (!inherits(object, "secuTrialdata")) stop("object of class secuTrialdata expected") obj <- object[2:length(object)] diff --git a/R/plot_recruitment.R b/R/plot_recruitment.R index c4fe64fb..a9d464e7 100644 --- a/R/plot_recruitment.R +++ b/R/plot_recruitment.R @@ -31,7 +31,7 @@ #' plot_recruitment(sT_export, rm_regex = "\\(.*\\)$") #' plot_recruitment <- function(x, return_data = FALSE, show_centres = TRUE, cex = 1, rm_regex = "") { - if (class(x) == "secuTrialdata") { + if (inherits(x, "secuTrialdata")) { # check for meta data Structure available if (! x$export_options$structure) { diff --git a/R/return_hidden_items.R b/R/return_hidden_items.R index bf79c87b..bc6b36ed 100644 --- a/R/return_hidden_items.R +++ b/R/return_hidden_items.R @@ -19,7 +19,7 @@ #' return_hidden_items(sT_export) #' return_hidden_items <- function(x) { - if (class(x) == "secuTrialdata") { + if (inherits(x, "secuTrialdata")) { if (! x$export_options$hidden_fields) { stop("Form data of hidden fields was not exported and will thus not be in this export.") diff --git a/R/return_random_participants.R b/R/return_random_participants.R index 5991bb35..c6c1be25 100644 --- a/R/return_random_participants.R +++ b/R/return_random_participants.R @@ -32,7 +32,7 @@ #' centres = c("Inselspital Bern (RPACK)", "Charité Berlin (RPACK)")) #' return_random_participants <- function(x, centres = "all", percent = 0.1, date = "1900-01-01", seed = 1) { - if (class(x) == "secuTrialdata") { + if (inherits(x, "secuTrialdata")) { # check for meta data Structure available if (! x$export_options$structure) { diff --git a/R/return_scores.R b/R/return_scores.R index 50698cd1..600625da 100644 --- a/R/return_scores.R +++ b/R/return_scores.R @@ -19,7 +19,7 @@ #' return_scores(sT_export) #' return_scores <- function(x) { - if (class(x) == "secuTrialdata") { + if (inherits(x, "secuTrialdata")) { curr_items <- x[[x$export_options$meta_names$items]] scores <- curr_items[grep("calculated|berechnet", curr_items$itemtype), ] scores_relevant_col <- scores[, c("ffcolname", "itemtype", "fflabel")] diff --git a/R/subset.R b/R/subset.R index 03a34f56..c93e8742 100644 --- a/R/subset.R +++ b/R/subset.R @@ -47,7 +47,7 @@ #' get_participants(sT_subset5) #' subset_secuTrial <- function(dat, participant = NULL, centre = NULL, exclude = FALSE) { - if (class(dat) != "secuTrialdata") { + if (!inherits(dat, "secuTrialdata")) { stop("subset_secuTrial() requires objects of the class 'secuTrialdata' as input parameter 'dat'.") } if (!is.null(participant) & !dat$export_options$add_id) { @@ -88,7 +88,7 @@ subset_secuTrial <- function(dat, participant = NULL, centre = NULL, exclude = F participant_sel <- new_dat[[meta["casenodes"]]][["mnppid"]] for (tab in names(new_dat)) { - if (class(new_dat[[tab]]) != "data.frame") { + if (!inherits(new_dat[[tab]], "data.frame")) { next } if ("mnppid" %in% names(new_dat[[tab]])) { diff --git a/README.Rmd b/README.Rmd index 7fdc7a53..2c1fd9f8 100644 --- a/README.Rmd +++ b/README.Rmd @@ -12,7 +12,7 @@ output: # secuTrialR -`r badger::badge_custom("dev version", as.character(packageVersion("secuTrialR")), "blue", "https://github.com/SwissClinicalTrialOrganisation/secuTrialR")` [![](https://www.r-pkg.org/badges/version/secuTrialR?color=green)](https://cran.r-project.org/package=secuTrialR) [![AppVeyor Build Status](https://ci.appveyor.com/api/projects/status/github/SwissClinicalTrialOrganisation/secuTrialR?branch=master&svg=true)](https://ci.appveyor.com/project/SwissClinicalTrialOrganisation/secuTrialR) [![travis](https://api.travis-ci.com/SwissClinicalTrialOrganisation/secuTrialR.svg?branch=master)](https://travis-ci.com/github/SwissClinicalTrialOrganisation/secuTrialR) [![Actions Status](https://github.com/SwissClinicalTrialOrganisation/secuTrialR/workflows/R-CMD-check/badge.svg)](https://github.com/SwissClinicalTrialOrganisation/secuTrialR/actions) [![codecov](https://codecov.io/github/SwissClinicalTrialOrganisation/secuTrialR/branch/master/graphs/badge.svg)](https://codecov.io/github/SwissClinicalTrialOrganisation/secuTrialR) +`r badger::badge_custom("dev version", as.character(packageVersion("secuTrialR")), "blue", "https://github.com/SwissClinicalTrialOrganisation/secuTrialR")` [![](https://www.r-pkg.org/badges/version/secuTrialR?color=green)](https://cran.r-project.org/package=secuTrialR) [![AppVeyor Build Status](https://ci.appveyor.com/api/projects/status/github/SwissClinicalTrialOrganisation/secuTrialR?branch=master&svg=true)](https://ci.appveyor.com/project/SwissClinicalTrialOrganisation/secuTrialR) [![travis](https://api.travis-ci.com/SwissClinicalTrialOrganisation/secuTrialR.svg?branch=master)](https://travis-ci.com/github/SwissClinicalTrialOrganisation/secuTrialR) [![Actions Status](https://github.com/SwissClinicalTrialOrganisation/secuTrialR/workflows/R-CMD-check/badge.svg)](https://github.com/SwissClinicalTrialOrganisation/secuTrialR/actions) An R package to handle data from the clinical data management system (CDMS) [secuTrial](https://www.secutrial.com/en/). diff --git a/README.md b/README.md index bd96b05a..b4c43c6c 100644 --- a/README.md +++ b/README.md @@ -2,14 +2,13 @@ # secuTrialR -[![](https://img.shields.io/badge/dev%20version-1.1.0-blue.svg)](https://github.com/SwissClinicalTrialOrganisation/secuTrialR) +[![](https://img.shields.io/badge/dev%20version-1.1.1-blue.svg)](https://github.com/SwissClinicalTrialOrganisation/secuTrialR) [![](https://www.r-pkg.org/badges/version/secuTrialR?color=green)](https://cran.r-project.org/package=secuTrialR) [![AppVeyor Build Status](https://ci.appveyor.com/api/projects/status/github/SwissClinicalTrialOrganisation/secuTrialR?branch=master&svg=true)](https://ci.appveyor.com/project/SwissClinicalTrialOrganisation/secuTrialR) [![travis](https://api.travis-ci.com/SwissClinicalTrialOrganisation/secuTrialR.svg?branch=master)](https://travis-ci.com/github/SwissClinicalTrialOrganisation/secuTrialR) [![Actions Status](https://github.com/SwissClinicalTrialOrganisation/secuTrialR/workflows/R-CMD-check/badge.svg)](https://github.com/SwissClinicalTrialOrganisation/secuTrialR/actions) -[![codecov](https://codecov.io/github/SwissClinicalTrialOrganisation/secuTrialR/branch/master/graphs/badge.svg)](https://codecov.io/github/SwissClinicalTrialOrganisation/secuTrialR) An R package to handle data from the clinical data management system (CDMS) [secuTrial](https://www.secutrial.com/en/).