diff --git a/DESCRIPTION b/DESCRIPTION index ab6c546..ba8e772 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,9 +1,10 @@ Package: corrplot Type: Package Title: Visualization of a Correlation Matrix -Version: 0.82 -Date: 2017-02-09 -Author: Taiyun Wei, Viliam Simko +Version: 0.83 +Date: 2017-08-24 +Author: Taiyun Wei and Viliam Simko with contributions by Michael Levy, + Yihui Xie, Yan Jin and jeffzemla Suggests: knitr, RColorBrewer, diff --git a/R/corrplot.R b/R/corrplot.R index 11ef0ff..47b2de1 100644 --- a/R/corrplot.R +++ b/R/corrplot.R @@ -217,6 +217,7 @@ #' #' @author Taiyun Wei (weitaiyun@@gmail.com) #' @author Viliam Simko (viliam.simko@@gmail.com) +#' @author Michael Levy (michael.levy@@healthcatalyst.com) #' #' @note \code{Cairo} and \code{cairoDevice} packages is strongly recommended to #' produce high-quality PNG, JPEG, TIFF bitmap files, especially for that @@ -799,12 +800,13 @@ corrplot <- function(corr, if (insig == "label_sig") { # Unless another character is specified, mark sig with * - if(!is.character(pch)) + if (!is.character(pch)) pch <- "*" - place_points <- function(sig.locs, point) + place_points <- function(sig.locs, point) { text(pos.pNew[,1][sig.locs], pos.pNew[,2][sig.locs], labels = point, col = pch.col, cex = pch.cex, lwd = 2) + } if (length(sig.level) == 1) { place_points(sig.locs = which(pNew < sig.level), point = pch) @@ -814,17 +816,19 @@ corrplot <- function(corr, for (i in seq_along(sig.level)) { iter <- l + 1 - i pchTmp <- paste(rep(pch, i), collapse = "") - if(i == length(sig.level)) { + if (i == length(sig.level)) { locs <- which(pNew < sig.level[iter]) - if (length(locs)) + if (length(locs)) { place_points(sig.locs = locs, point = pchTmp) + } } else { locs <- which(pNew < sig.level[iter] & pNew > sig.level[iter - 1]) - if(length(locs)) + if (length(locs)) { place_points(sig.locs = locs, point = pchTmp) + } } - } + } } else { diff --git a/inst/CITATION b/inst/CITATION index 0831116..8817e07 100644 --- a/inst/CITATION +++ b/inst/CITATION @@ -1,7 +1,8 @@ PKG <- "corrplot" VERSION <- packageVersion(PKG) TITLE <- packageDescription(PKG, fields = "Title") -AUTHORS <- packageDescription(PKG, fields = "Author") +AUTHORS <- gsub("\\s+with contrib.*", " et al.", + packageDescription(PKG, fields = "Author")) URL <- packageDescription(PKG, fields = "URL") YEAR <- strftime(packageDescription(PKG, fields = "Date"), "%Y") diff --git a/man/corrplot.Rd b/man/corrplot.Rd index 6109e27..031da09 100644 --- a/man/corrplot.Rd +++ b/man/corrplot.Rd @@ -465,4 +465,6 @@ Function \code{plotcorr} in the \code{ellipse} package and Taiyun Wei (weitaiyun@gmail.com) Viliam Simko (viliam.simko@gmail.com) + +Michael Levy (michael.levy@healthcatalyst.com) } diff --git a/tests/testthat/test-corrplot.R b/tests/testthat/test-corrplot.R index 5053bcd..86d0bc0 100644 --- a/tests/testthat/test-corrplot.R +++ b/tests/testthat/test-corrplot.R @@ -216,7 +216,7 @@ test_that("Issue #76: separate `col` parameters corrplot.mixed", { upper = "number", upper.col = "black")) }) -test_that("Mark significant correlations", { +test_that("Issue #99: Mark significant correlations", { M <- cor(mtcars) fakepmat <- 1 - abs(M) ^ .2 # Hmisc::rcorr provides a p-value matrix, but # don't want to introduce the dependency