Skip to content

Commit

Permalink
clean up for CRAN
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnMount committed Apr 14, 2023
1 parent 30c4f64 commit 30f1559
Show file tree
Hide file tree
Showing 10 changed files with 40 additions and 42 deletions.
2 changes: 2 additions & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,5 @@
^extras$
^Examples$

^doc$
^Meta$
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,5 @@ inst/doc
*~
.DS_Store
CRAN-RELEASE
/doc/
/Meta/
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Package: WVPlots
Type: Package
Title: Common Plots for Analysis
Version: 1.3.3
Date: 2021-04-10
Date: 2023-04-14
Authors@R: c(
person("John", "Mount", email = "[email protected]", role = c("aut", "cre")),
person("Nina", "Zumel", email = "[email protected]", role = c("aut")),
Expand Down
2 changes: 1 addition & 1 deletion R/GainCurve.R
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ thin_frame_by_orders <- function(d, cols, groupcol, large_count) {
#' The x-axis represents the fraction of items seen when sorted by score, and the
#' y-axis represents the cumulative summed true outcome represented by the items seen so far.
#' See, for example,
#' \url{https://www.ibm.com/support/knowledgecenter/SSLVMB_24.0.0/spss/tutorials/mlp_bankloan_outputtype_02.html}.
#' \url{https://www.ibm.com/docs/SSLVMB_24.0.0/spss/tutorials/mlp_bankloan_outputtype_02.html}.
#'
#' For comparison, \code{GainCurvePlot} also plots the "wizard curve": the gain curve when the
#' data is sorted according to its true outcome.
Expand Down
3 changes: 2 additions & 1 deletion R/PRPlot.R
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,8 @@ PRPlot <- function(frame, xvar, truthVar, truthTarget, title,
isoFrame$Precision <- bestF1*isoFrame$Recall/(2*isoFrame$Recall-bestF1)
isoFrame <- isoFrame[(isoFrame$Precision<=1) & (isoFrame$Precision>0),]
#f1check <- 2*isoFrame$Recall*isoFrame$Precision/(isoFrame$Recall+isoFrame$Precision)

Precision <- NULL # don't look unbound in CRAN checks
Recall <- NULL # don't look unbound in CRAN checks
pString <- ''
if(estimate_sig && requireNamespace('sigr',quietly = TRUE)) {
sp <- sigr::permutationScoreModel(predcol,outcol,
Expand Down
20 changes: 18 additions & 2 deletions R/ROC.R
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,8 @@ ROCPlot <- function(frame, xvar, truthVar, truthTarget, title,
aucString <- sprintf('%.2g',auc)
subtitle <- paste('AUC =', aucString)
}
FalsePositiveRate <- NULL # don't look unbound in CRAN check
TruePositiveRate <- NULL # don't look unbound in CRAN check
plot <- ggplot2::ggplot() +
ggplot2::geom_ribbon(data=rocList$lineGraph,
mapping=ggplot2::aes(x=FalsePositiveRate,
Expand All @@ -221,8 +223,8 @@ ROCPlot <- function(frame, xvar, truthVar, truthTarget, title,
ggplot2::ylim(0,1) + ggplot2::xlim(0,1) +
ggplot2::ylab('TruePositiveRate (Sensitivity)') +
ggplot2::xlab('FalsePositiveRate (1 - Specificity)')
Specificity <- NULL # don't look unbound
Sensitivity <- NULL # don't look unbound
Specificity <- NULL # don't look unbound in CRAN check
Sensitivity <- NULL # don't look unbound in CRAN check
if(add_beta1_ideal_curve) {
# match the displayed curve
a <- b <- NULL # don't look unbound
Expand Down Expand Up @@ -356,6 +358,9 @@ ROCPlotPair <- function(frame, xvar1, xvar2, truthVar, truthTarget, title,
title = title,
funname = "WVPlots::ROCPlotPair")
outcol <- frame[[truthVar]]==truthTarget
FalsePositiveRate <- NULL # don't look unbound in CRAN check
TruePositiveRate <- NULL # don't look unbound in CRAN check
model <- NULL # don't look unbound in CRAN check
if(length(unique(outcol))!=2) {
return(NULL)
}
Expand Down Expand Up @@ -491,6 +496,11 @@ ROCPlotList <- function(
function(v) {paste0(v,', AUC=',sprintf('%.2g',rocLists[[v]]$area))}
)

FalsePositiveRate <- NULL # don't look unbound in CRAN check
TruePositiveRate <- NULL # don't look unbound in CRAN check
model <- NULL # don't look unbound in CRAN check
dataset <- NULL # don't look unbound in CRAN check

for(v in xvar_names) {
rocLists[[v]]$pointGraph$model <- nmList[[v]]
rocLists[[v]]$lineGraph$model <- nmList[[v]]
Expand Down Expand Up @@ -611,6 +621,12 @@ ROCPlotPair2 <- function(nm1, frame1, xvar1, truthVar1, truthTarget1,
name_var_list = list(xvar2 = xvar2, truthVar2 = truthVar2),
title = title,
funname = "WVPlots::ROCPlotPair2")

FalsePositiveRate <- NULL # don't look unbound in CRAN check
TruePositiveRate <- NULL # don't look unbound in CRAN check
model <- NULL # don't look unbound in CRAN check
dataset <- NULL # don't look unbound in CRAN check

test <- NULL # used as a symbol, declare not an unbound variable
outcol1 <- frame1[[truthVar1]]==truthTarget1
if(length(unique(outcol1))!=2) {
Expand Down
6 changes: 4 additions & 2 deletions R/SimulateAESString.R
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,11 @@
#' xvar <- 'x' # the idea is, this is passed in and not known at coding time
#' yvar <- 'y'
#' # what we want:
#' # ggplot2::ggplot(data = d, mapping = ggplot2::aes_string(x = xvar, y = yvar)) + ggplot2::geom_point()
#' # ggplot2::ggplot(data = d, mapping = ggplot2::aes_string(x = xvar, y = yvar)) +
#' # ggplot2::geom_point()
#' # The required "tidy evaluation ideoms[sic] with `aes()`".
#' ggplot2::ggplot(data = d, mapping = ggplot2::aes(!!!simulate_aes_string(x = xvar, y = yvar))) + ggplot2::geom_point()
#' ggplot2::ggplot(data = d, mapping = ggplot2::aes(!!!simulate_aes_string(x = xvar, y = yvar))) +
#' ggplot2::geom_point()
#'
#' @export
simulate_aes_string <- function(...) {
Expand Down
37 changes: 5 additions & 32 deletions cran-comments.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,12 @@

### OSX

R CMD check --as-cran WVPlots_1.3.2.tar.gz
* using R version 4.0.2 (2020-06-22)
R CMD check --as-cran WVPlots_1.3.3.tar.gz
* using log directory ‘/Users/johnmount/Documents/work/WVPlots.Rcheck’
* using R version 4.2.2 (2022-10-31)
* using platform: x86_64-apple-darwin17.0 (64-bit)
* using session charset: UTF-8
* using option ‘--as-cran’
* checking for file ‘WVPlots/DESCRIPTION’ ... OK
* checking extension type ... Package
* this is package ‘WVPlots’ version ‘1.3.2’
* checking CRAN incoming feasibility ... Note_to_CRAN_maintainers
Maintainer: ‘John Mount <[email protected]>’
* using option ‘--as-cran
...
Status: OK

Expand All @@ -25,30 +21,7 @@
Timeout was reached: [win-builder.r-project.org] FTP response timeout

rhub::check_for_cran()
854#> setting _R_CHECK_FORCE_SUGGESTS_ to false
855#> setting R_COMPILE_AND_INSTALL_PACKAGES to never
856#> setting _R_CHECK_THINGS_IN_CHECK_DIR_ to false
857#> setting R_REMOTES_STANDALONE to true
858#> setting R_REMOTES_NO_ERRORS_FROM_WARNINGS to true
859#> setting _R_CHECK_FORCE_SUGGESTS_ to true
860#> setting _R_CHECK_CRAN_INCOMING_USE_ASPELL_ to true
861#> * using log directory 'C:/Users/USERtuXsbaQdWo/WVPlots.Rcheck'
862#> * using R Under development (unstable) (2020-12-14 r79633)
863#> * using platform: x86_64-w64-mingw32 (64-bit)
864#> * using session charset: ISO8859-1
865#> * using option '--as-cran'
866#> * checking extension type ... Package
867#> * this is package 'WVPlots' version '1.3.2'
868#> * checking for file 'WVPlots/DESCRIPTION' ... OK
869#> * checking CRAN incoming feasibility ... Note_to_CRAN_maintainers
870#> Maintainer: 'John Mount '
871#> * checking package namespace information ... OK
872#> * checking package dependencies ... NOTE
873#> Suggests orphaned package: 'plotly'
...
927#> Status: 1 NOTE
We hope plotly will move out of orphaned status soon,
if not we will later remove the suggestion.


## Downstream dependencies

Expand Down
2 changes: 1 addition & 1 deletion man/GainCurvePlot.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 4 additions & 2 deletions man/simulate_aes_string.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 30f1559

Please sign in to comment.