217217# '
218218# ' @author Taiyun Wei (weitaiyun@@gmail.com)
219219# ' @author Viliam Simko (viliam.simko@@gmail.com)
220+ # ' @author Michael Levy (michael.levy@@healthcatalyst.com)
220221# '
221222# ' @note \code{Cairo} and \code{cairoDevice} packages is strongly recommended to
222223# ' produce high-quality PNG, JPEG, TIFF bitmap files, especially for that
@@ -799,12 +800,13 @@ corrplot <- function(corr,
799800 if (insig == " label_sig" ) {
800801
801802 # Unless another character is specified, mark sig with *
802- if (! is.character(pch ))
803+ if (! is.character(pch ))
803804 pch <- " *"
804805
805- place_points <- function (sig.locs , point )
806+ place_points <- function (sig.locs , point ) {
806807 text(pos.pNew [,1 ][sig.locs ], pos.pNew [,2 ][sig.locs ],
807808 labels = point , col = pch.col , cex = pch.cex , lwd = 2 )
809+ }
808810
809811 if (length(sig.level ) == 1 ) {
810812 place_points(sig.locs = which(pNew < sig.level ), point = pch )
@@ -814,17 +816,19 @@ corrplot <- function(corr,
814816 for (i in seq_along(sig.level )) {
815817 iter <- l + 1 - i
816818 pchTmp <- paste(rep(pch , i ), collapse = " " )
817- if (i == length(sig.level )) {
819+ if (i == length(sig.level )) {
818820 locs <- which(pNew < sig.level [iter ])
819- if (length(locs ))
821+ if (length(locs )) {
820822 place_points(sig.locs = locs , point = pchTmp )
823+ }
821824 } else {
822825 locs <- which(pNew < sig.level [iter ] & pNew > sig.level [iter - 1 ])
823- if (length(locs ))
826+ if (length(locs )) {
824827 place_points(sig.locs = locs , point = pchTmp )
828+ }
825829 }
826-
827830 }
831+
828832 }
829833
830834 } else {
0 commit comments