taiyun / corrplot

A visual exploratory tool on correlation matrix
https://github.com/taiyun/corrplot
Other
316 stars 86 forks source link

format correlations with nsmall = number.digits #276

Closed the-mad-statter closed 3 months ago

the-mad-statter commented 6 months ago

Addresses Issue #275.

The correlation between drat and gear is now listed as 0.70 and not 0.7.

library(dplyr)
library(corrplot)

M <- mtcars |> select(gear, am, drat) |> cor()

corrplot(
  M, 
  type = "lower", 
  diag = FALSE, 
  addCoef.col = "black", 
  number.digits = 2
)

Created on 2024-04-29 with reprex v2.1.0