Skip to content

Conversation

@erinnacland
Copy link

I added an option to remove the leading zeros for the correlation values in 'method = "number"' and 'addCoef.col'. It is by default turned off.

I added an option to remove the leading zeros for the correlation values in 'method = "number"' and 'addCoef.col'. It is by default turned off.
@erinnacland
Copy link
Author

(this option has also been requested in issues):

#267

Copy link
Contributor

@jeffzemla jeffzemla left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR has a few issues:

  1. It does not load. There is a duplicated if statement that causes an error (lines 890-891 should be deleted)

  2. del.lead.zero=TRUE overrides number.digits setting (i.e., it forces number.digits=2)

I suggest replacing line 328 with:

del.lead.zero = function(val) {sub("^(-?)0.", "\1.", val) }}

and reverse the order of the format/del.lead.zero functions when called later so it executes on the format()ed string:

change line 713 to:

labels = del.lead.zero(format(round(x, number.digits), nsmall = number.digits)),

change line 896 to (and fix the parens so nsmall=number.digits is passed to format()):

labels = del.lead.zero(format(

Not sure how (or if possible) to edit a PR, but if @taiyun would like I can submit a new PR with the changes, add an example to the vignette, add to ?corrplot, and add a MRE to #274

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants