Skip to content

Commit 9eb6a62

Browse files
committed
fix factor issue
rebuild and recheck
1 parent 3817a5c commit 9eb6a62

19 files changed

+303
-185
lines changed

DESCRIPTION

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ Package: WVPlots
22
Type: Package
33
Title: Common Plots for Analysis
44
Version: 1.2.4
5-
Date: 2020-02-02
5+
Date: 2020-02-19
66
Authors@R: c(
77
person("John", "Mount", email = "[email protected]", role = c("aut", "cre")),
88
person("Nina", "Zumel", email = "[email protected]", role = c("aut")),
@@ -24,8 +24,8 @@ Imports:
2424
wrapr (>= 1.9.6),
2525
sigr (>= 1.0.6),
2626
cdata (>= 1.1.6),
27-
rqdatatable (>= 1.2.6),
28-
rquery (>= 1.4.3),
27+
rqdatatable (>= 1.2.7),
28+
rquery (>= 1.4.4),
2929
utils,
3030
grid,
3131
gridExtra,

NEWS.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11

2-
# WVPlots 1.2.4 2020-02-02
2+
# WVPlots 1.2.4 2020-02-19
33

4+
* Fix character/factor issue (upcoming in R4.0.0).
45
* Add rmarkdown suggest.
56
* Badges.
67

R/ClevelandDotPlot.R

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,10 @@ ClevelandDotPlot = function(frm, xvar, title, ...,
7272
stop("parameter limit_n must be at least 1")
7373
}
7474

75+
if(!is.factor(frm[[xvar]])) {
76+
frm[[xvar]] <- as.factor(frm[[xvar]])
77+
}
78+
7579
# to get the top N, we always use decreasing sort order
7680
if(!is.null(limit_n)) {
7781
tab = table(frm[[xvar]])

R/GainCurve.R

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ GainCurvePlot = function(frame, xvar, truthVar, title,
177177
pct_outcome = results$wizard,
178178
sort_criterion = "wizard",
179179
stringsAsFactors = FALSE)
180-
results <- rbind(r1, r2)
180+
results <- rbind(r1, r2, stringsAsFactors = FALSE)
181181
# rename sort_criterion
182182
sortKeyM <- c('model' = paste('model: sort by', xvar),
183183
'wizard' = paste('wizard: sort by', truthVar))
@@ -303,7 +303,7 @@ makeRelativeGiniCostScorer <- function(costcol) {
303303
sum(d[['truthcol']]),
304304
sort_criterion = wName
305305
)
306-
results = rbind(resultsM, resultsW)
306+
results = rbind(resultsM, resultsW, stringsAsFactors = FALSE)
307307

308308
# calculate the areas under each curve
309309
# gini score is 2* (area - 0.5)
@@ -403,7 +403,7 @@ GainCurvePlotC = function(frame, xvar, costVar, truthVar, title,
403403
pct_outcome = cumsum(d[wizard, 'truthcol']) / sum(d[['truthcol']]),
404404
sort_criterion = wName
405405
)
406-
results = rbind(resultsM, resultsW)
406+
results = rbind(resultsM, resultsW, stringsAsFactors = FALSE)
407407

408408
# calculate the areas under each curve
409409
# gini score is 2* (area - 0.5)

R/LiftCurve.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ LiftCurvePlot = function(frame, xvar, truthVar, title,
8888
pct_outcome = results$wizard_lift,
8989
sort_criterion = "wizard",
9090
stringsAsFactors = FALSE)
91-
results <- rbind(r1, r2)
91+
results <- rbind(r1, r2, stringsAsFactors = FALSE)
9292
# rename sort_criterion
9393
msort_str <- paste('model: sort by', xvar)
9494
sortKeyM <- c('model' = msort_str,

R/PlotDistCountBinomial.R

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ NULL
3737
#' class_size = 35
3838
#' nclasses = 100
3939
#' true_frate = 0.4
40-
#' fdata = data.frame(n_female = rbinom(nclasses, class_size, true_frate))
40+
#' fdata = data.frame(n_female = rbinom(nclasses, class_size, true_frate), stringsAsFactors = FALSE)
4141
#'
4242
#' title = paste("Distribution of count of female students, class size =", class_size)
4343
#' # compare to empirical p
@@ -49,7 +49,8 @@ NULL
4949
#'
5050
#' # Example where the distribution is not of a true single binomial
5151
#' fdata2 = rbind(data.frame(n_female = rbinom(50, class_size, 0.25)),
52-
#' data.frame(n_female = rbinom(10, class_size, 0.60)) )
52+
#' data.frame(n_female = rbinom(10, class_size, 0.60)),
53+
#' stringsAsFactors = FALSE )
5354
#' PlotDistCountBinomial(fdata2, "n_female", class_size, title)
5455
#'
5556
#' @export

R/ROC.R

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -281,8 +281,8 @@ ROCPlotPair <- function(frame, xvar1, xvar2, truthVar, truthTarget, title,
281281
rocList2$pointGraph$model <- nm2
282282
rocList2$lineGraph$model <- nm2
283283

284-
pointGraph <- rbind(rocList1$pointGraph,rocList2$pointGraph)
285-
lineGraph <- rbind(rocList1$lineGraph,rocList2$lineGraph)
284+
pointGraph <- rbind(rocList1$pointGraph, rocList2$pointGraph, stringsAsFactors = FALSE)
285+
lineGraph <- rbind(rocList1$lineGraph, rocList2$lineGraph, stringsAsFactors = FALSE)
286286
palletName = palette
287287
plot <- ggplot2::ggplot()
288288
if(nrow(pointGraph)<=1000) {
@@ -418,8 +418,8 @@ ROCPlotPair2 <- function(nm1, frame1, xvar1, truthVar1, truthTarget1,
418418
rocList1$lineGraph$dataset <- nm1
419419
rocList2$pointGraph$dataset <- nm2
420420
rocList2$lineGraph$dataset <- nm2
421-
pointGraph <- rbind(rocList1$pointGraph,rocList2$pointGraph)
422-
lineGraph <- rbind(rocList1$lineGraph,rocList2$lineGraph)
421+
pointGraph <- rbind(rocList1$pointGraph, rocList2$pointGraph, stringsAsFactors = FALSE)
422+
lineGraph <- rbind(rocList1$lineGraph, rocList2$lineGraph, stringsAsFactors = FALSE)
423423
palletName = palette
424424
plot <- ggplot2::ggplot()
425425
if(nrow(pointGraph)<=1000) {

R/wv_gapply.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ wv_gapply <- function(df,gcolumn,f,
7979
)
8080
}
8181
if(bindrows) {
82-
res <- do.call("rbind", res)
82+
res <- do.call("rbind", c(res, list(stringsAsFactors = FALSE)))
8383
}
8484
return(res)
8585
}

cran-comments.md

Lines changed: 5 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -3,38 +3,23 @@
33

44
### OSX
55

6-
R CMD check --as-cran WVPlots_1.2.3.tar.gz
7-
* using R version 3.6.0 (2019-04-26)
6+
R CMD check --as-cran WVPlots_1.2.4.tar.gz
7+
* using R version 3.6.2 (2019-12-12)
88
* using platform: x86_64-apple-darwin15.6.0 (64-bit)
99
* using session charset: UTF-8
1010
* using option ‘--as-cran’
1111
* checking for file ‘WVPlots/DESCRIPTION’ ... OK
1212
* checking extension type ... Package
13-
* this is package ‘WVPlots’ version ‘1.2.3
13+
* this is package ‘WVPlots’ version ‘1.2.4
1414
* checking CRAN incoming feasibility ... Note_to_CRAN_maintainers
1515
Maintainer: ‘John Mount <[email protected]>’
1616
Status: OK
1717

1818
### Windows
1919

2020
rhub::check_for_cran()
21-
968#> setting _R_CHECK_FORCE_SUGGESTS_ to false
22-
969#> setting R_COMPILE_AND_INSTALL_PACKAGES to never
23-
970#> setting R_REMOTES_STANDALONE to true
24-
971#> setting R_REMOTES_NO_ERRORS_FROM_WARNINGS to true
25-
972#> setting _R_CHECK_FORCE_SUGGESTS_ to true
26-
973#> setting _R_CHECK_CRAN_INCOMING_USE_ASPELL_ to true
27-
974#> * using log directory 'C:/Users/USERkZjcMBnuWD/WVPlots.Rcheck'
28-
975#> * using R Under development (unstable) (2020-01-07 r77637)
29-
976#> * using platform: x86_64-w64-mingw32 (64-bit)
30-
977#> * using session charset: ISO8859-1
31-
978#> * using option '--as-cran'
32-
979#> * checking for file 'WVPlots/DESCRIPTION' ... OK
33-
980#> * checking extension type ... Package
34-
981#> * this is package 'WVPlots' version '1.2.3'
35-
982#> * checking CRAN incoming feasibility ... Note_to_CRAN_maintainers
36-
983#> Maintainer: 'John Mount '
37-
1039#> Status: OK
21+
devtools::check_win_devel()
22+
3823

3924
## Downstream dependencies
4025

0 commit comments

Comments
 (0)