Skip to content

Commit

Permalink
Merge pull request #254 from aghaynes/master
Browse files Browse the repository at this point in the history
Fix CRAN notes
  • Loading branch information
aghaynes authored Mar 2, 2023
2 parents ec2c390 + 7082668 commit f0034ed
Show file tree
Hide file tree
Showing 14 changed files with 17 additions and 15 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
3 changes: 3 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -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

Expand Down
2 changes: 1 addition & 1 deletion R/annual_recruitment.R
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion R/check_export_options.R
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion R/diff_secuTrial.R
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion R/get.R
Original file line number Diff line number Diff line change
Expand Up @@ -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.")
}

Expand Down
2 changes: 1 addition & 1 deletion R/links_secuTrial.R
Original file line number Diff line number Diff line change
Expand Up @@ -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)]


Expand Down
2 changes: 1 addition & 1 deletion R/plot_recruitment.R
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion R/return_hidden_items.R
Original file line number Diff line number Diff line change
Expand Up @@ -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.")
Expand Down
2 changes: 1 addition & 1 deletion R/return_random_participants.R
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion R/return_scores.R
Original file line number Diff line number Diff line change
Expand Up @@ -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")]
Expand Down
4 changes: 2 additions & 2 deletions R/subset.R
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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]])) {
Expand Down
2 changes: 1 addition & 1 deletion README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -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/).

Expand Down
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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/).
Expand Down

0 comments on commit f0034ed

Please sign in to comment.