Skip to content

Commit

Permalink
Merge pull request #44 from dpc10ster/cran2-fix
Browse files Browse the repository at this point in the history
Cran2 fixed
# Reason for revised submission
* This is an update to CRAN version 1.3.1 which installed with no errors, warnings, or notes (2020-01-13) on all platforms. 
* Recently it was brought to my attention (by Kurt Hornik <[email protected]>) that the package was generating errors on `R-devel` (>r77865) running on several Linux platforms.
* The errors were identified as likely due to the new default behavior for option `stringsAsFactors = FALSE` in functions `data.frame()` and `read.table()`.
* This update (V1.3.2) corrects those errors.
  • Loading branch information
dpc10ster authored Mar 6, 2020
2 parents f1779aa + 5631115 commit b95aa57
Show file tree
Hide file tree
Showing 25 changed files with 206 additions and 217 deletions.
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
Package: RJafroc
Type: Package
Title: Analyzing Diagnostic Observer Performance Studies
Version: 1.3.1
Date: 2020-01-31
Version: 1.3.2
Date: 2020-03-06
Authors@R: c(person("Dev", "Chakraborty", role = c("cre","aut","cph"), email = "[email protected]"),
person("Peter", "Philips", role = c("aut"), email = "[email protected]"),
person("Xuetong", "Zhai", role = c("aut"), email = "[email protected]"),
Expand Down
2 changes: 1 addition & 1 deletion NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export(DfReadLrocDataFile)
export(DfSaveDataFile)
export(FitBinormalRoc)
export(FitCbmRoc)
export(FitCorCbm)
export(FitCorCbmRoc)
export(FitRsmRoc)
export(PlotBinormalFit)
export(PlotCbmFit)
Expand Down
22 changes: 19 additions & 3 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,22 @@
# RJafroc 1.3.1

## After initial comments from CRAN
# RJafroc 1.3.2

## After email from Kurt Hornik <[email protected]>
* Created new branch off `cran2` 1.3.1 called `cran2-fix`
* Bumped version to 1.3.2
* RJafroc failing on Linux
+ r-devel-linux-x86_64-debian-clang
+ r-devel-linux-x86_64-debian-gcc
+ r-devel-linux-x86_64-fedora-clang (this showed up post email)
+ r-devel-linux-x86_64-fedora-gcc (this showed up post email)
* Has to do with new default (R 4.0.0) for `options(stringsAsFactors = FALSE)`
* To recreate this problem in `R CMD check` I set `options(stringsAsFactor=FALSE)` near beginning of each plotting function (3 functions) using `data.frame()` and `levels()` to convert strings to factor levels
* To make problem go away I explicitly specified `stringsAsFactor=TRUE` in each call to `data.frame()` where necessary.
* Removed examples from FitCorCbmRoc() as they were generating excessive CPU time NOTES. Will need to add these to vignettes, later.
* Ran `R CMD check` successfully
* Ran all checks in ScriptsForCranSubmission.R
* Submitted to CRAN

## After initial comments from CRAN upon submission of version 1.3.0
* Changes to DESCRIPTION file (removed emphasis characters and url before <)
* Added a sentence on improved sample size routines
* Bumped version to 1.3.1
Expand Down
4 changes: 2 additions & 2 deletions R/DfCreateCorCbmDataset.R
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#' Create paired dataset for testing \code{\link{FitCorCbm}}
#' Create paired dataset for testing \code{\link{FitCorCbmRoc}}
#'
#' @description The paired dataset is generated using bivariate sampling;
#' details are in referenced publication
Expand All @@ -21,7 +21,7 @@
#' @details The ROC data is bined to 5 bins in each condition.
#'
#'
#' @return The return value is the desired dataset, suitable for testing \code{\link{FitCorCbm}}.
#' @return The return value is the desired dataset, suitable for testing \code{\link{FitCorCbmRoc}}.
#'
#'
#'
Expand Down
2 changes: 1 addition & 1 deletion R/DfExtractCorCbmDataset.R
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
#' is that implied by the first treatement
#' and the second reader, which is one arm, and the other arm is that implied by the second
#' treatment paired with the first
#' reader. Using this method any allowed pairing can be extracted and analyzed by \code{\link{FitCorCbm}}.
#' reader. Using this method any allowed pairing can be extracted and analyzed by \code{\link{FitCorCbmRoc}}.
#' The utility of this software is
#' in designing a ratings simulator that is statistically matched to a real dataset.
#'
Expand Down
39 changes: 21 additions & 18 deletions R/FitCorCbm.R → R/FitCorCbmRoc.R
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
#' treatment, the same reader interpreting images in different treatments, or
#' different readers interpreting images in 2 different treatments. Function
#' \code{\link{DfExtractCorCbmDataset}} can be used to construct a dataset suitable for
#' \code{FitCorCbm}. With reference to the returned values, and assuming R bins
#' \code{FitCorCbmRoc}. With reference to the returned values, and assuming R bins
#' in condition X and L bins in conditon Y,
#' \code{FPCounts} is the R x L matrix containing the counts for non-diseased cases,
#' \code{TPCounts} is the R x L matrix containing the counts for diseased cases;
Expand All @@ -37,22 +37,22 @@
#' has one less dimension (along each edge) for each parameter that is held constant.
#' The indices of the parameters held fixed are in \code{fitCorCbmRet$fixParam}.
#'
#' @examples
#' \dontrun{
#' ## this takes 85 sec to execute on OSX
#' dataset <- DfExtractCorCbmDataset(dataset05, trts = 1, rdrs = c(4,7))
#' ret <- FitCorCbm(dataset)
#' print(ret$fitCorCbmRet)
#' print(ret$stats)
#' print(ret$fittedPlot)
#'
#' ## this takes very long to execute
#' ret <- FitCorCbm(datasetBinned123)
#' print(ret$fitCorCbmRet)
#' print(ret$stats)
#' print(ret$fittedPlot)
#' ## Also try two other datasets ending with 124 and 125
#' }
## following examples generate excessive CPU time NOTES on devtools::check_win_xx()
## but it is instructive to execute them independently
## see also the publication referenced below
##
## dataset <- DfExtractCorCbmDataset(dataset05, trts = 1, rdrs = c(4,7))
## ret <- FitCorCbmRoc(dataset)
## print(ret$fitCorCbmRet)
## print(ret$stats)
## print(ret$fittedPlot)
##
##
## ret <- FitCorCbmRoc(datasetBinned123)
## print(ret$fitCorCbmRet)
## print(ret$stats)
## print(ret$fittedPlot)
## Also try two other datasets ending with 124 and 125
#'
#'
#' @references
Expand All @@ -68,7 +68,9 @@
#' @export
#'
#'
FitCorCbm <- function(dataset){
FitCorCbmRoc <- function(dataset){
options(stringsAsFactors = FALSE) # check compatibility with new default for R 4.0.0

if (dataset$dataType != "ROC") {
stop("This program requires an ROC dataset")
}
Expand Down Expand Up @@ -510,6 +512,7 @@ PlotCorCbmFit <- function(retFitCorCBM){
plotOpPnts <- NULL
FPFX <- 1 - pnorm(plotZeta)
TPFX <- (1 - alphaX) * (1 - pnorm(plotZeta)) + alphaX * (1 - pnorm(plotZeta, mean = muX))

plotCBM <- rbind(plotCBM, data.frame(FPF = FPFX, TPF = TPFX, Condition = "X"))
FPFX <- cumsum(rev(rowSums(FPCounts)))/K1
TPFX <- cumsum(rev(rowSums(TPCounts)))/K2
Expand Down
1 change: 1 addition & 0 deletions R/PlotBinormalFit.R
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ PlotBinormalFit <- function(a, b){
FPF <- c(1, FPF, 0)
TPF <- pnorm(a[i] - b[i] * plotZeta)
TPF <- c(1, TPF, 0)

plotBM <- rbind(plotBM, data.frame(FPF = FPF, TPF = TPF, Treatment = as.character(i)))
}
bmROCCurve <- with(plotBM,{
Expand Down
Loading

0 comments on commit b95aa57

Please sign in to comment.