From 30f155941c9098648b0dd5e1d2f5341211027073 Mon Sep 17 00:00:00 2001 From: John Mount Date: Fri, 14 Apr 2023 10:57:09 -0700 Subject: [PATCH] clean up for CRAN --- .Rbuildignore | 2 ++ .gitignore | 2 ++ DESCRIPTION | 2 +- R/GainCurve.R | 2 +- R/PRPlot.R | 3 ++- R/ROC.R | 20 ++++++++++++++++++-- R/SimulateAESString.R | 6 ++++-- cran-comments.md | 37 +++++-------------------------------- man/GainCurvePlot.Rd | 2 +- man/simulate_aes_string.Rd | 6 ++++-- 10 files changed, 40 insertions(+), 42 deletions(-) diff --git a/.Rbuildignore b/.Rbuildignore index 7ced9b4..f20a887 100644 --- a/.Rbuildignore +++ b/.Rbuildignore @@ -20,3 +20,5 @@ ^extras$ ^Examples$ +^doc$ +^Meta$ diff --git a/.gitignore b/.gitignore index 14e1e9e..10e834e 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,5 @@ inst/doc *~ .DS_Store CRAN-RELEASE +/doc/ +/Meta/ diff --git a/DESCRIPTION b/DESCRIPTION index 6eeaf5a..837369f 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -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 = "jmount@win-vector.com", role = c("aut", "cre")), person("Nina", "Zumel", email = "nzumel@win-vector.com", role = c("aut")), diff --git a/R/GainCurve.R b/R/GainCurve.R index b3e0158..57e3d18 100644 --- a/R/GainCurve.R +++ b/R/GainCurve.R @@ -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. diff --git a/R/PRPlot.R b/R/PRPlot.R index 8ae8678..c7f654a 100644 --- a/R/PRPlot.R +++ b/R/PRPlot.R @@ -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, diff --git a/R/ROC.R b/R/ROC.R index 1e531d0..85390d9 100644 --- a/R/ROC.R +++ b/R/ROC.R @@ -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, @@ -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 @@ -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) } @@ -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]] @@ -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) { diff --git a/R/SimulateAESString.R b/R/SimulateAESString.R index 07af2fe..81bb1e9 100644 --- a/R/SimulateAESString.R +++ b/R/SimulateAESString.R @@ -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(...) { diff --git a/cran-comments.md b/cran-comments.md index 7b85e6a..6e5f72f 100644 --- a/cran-comments.md +++ b/cran-comments.md @@ -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 ’ + * using option ‘--as-cran ... Status: OK @@ -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 diff --git a/man/GainCurvePlot.Rd b/man/GainCurvePlot.Rd index 5811717..226988e 100644 --- a/man/GainCurvePlot.Rd +++ b/man/GainCurvePlot.Rd @@ -53,7 +53,7 @@ to the true outcome value. 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. diff --git a/man/simulate_aes_string.Rd b/man/simulate_aes_string.Rd index 4453792..f819e69 100644 --- a/man/simulate_aes_string.Rd +++ b/man/simulate_aes_string.Rd @@ -25,8 +25,10 @@ d <- data.frame(x = c(1, 2, 3), y = c(4, 5, 6)) 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() }