Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ggcorrplot gains digits argument #12

Merged
merged 2 commits into from Aug 30, 2018
Merged

Conversation

@IndrajeetPatil
Copy link
Contributor

@IndrajeetPatil IndrajeetPatil commented Aug 30, 2018

This lets the user control how many decimal points to be displayed for correlation coefficients in the matrix.
Importantly, this change is backward-compatible. Previously, you were rounding up digits in the correlation matrix. If that's the case, the function will still display what it used to display.

Here are examples:

library(ggcorrplot)
#> Loading required package: ggplot2

# Compute a correlation matrix
data(mtcars)

# formatted
corr1 <- round(cor(mtcars), 1)

# non-formatted
corr2 <- cor(mtcars)

# Compute a matrix of correlation p-values
p.mat <- cor_pmat(mtcars)

# Visualize the correlation matrix

# preserves formatted matrix
ggcorrplot(corr1, lab = TRUE, digits = 2)

ggcorrplot(corr2, lab = TRUE, digits = 2)

Created on 2018-08-30 by the reprex package (v0.2.0.9000).

@kassambara
Copy link
Owner

@kassambara kassambara commented Aug 30, 2018

good point, thanks

@kassambara kassambara merged commit dd54397 into kassambara:master Aug 30, 2018
kassambara added a commit that referenced this pull request Aug 30, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants
You can’t perform that action at this time.