taiyun / corrplot

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

Left-only option for text labels (tl.pos = "l") #227

Closed ggordn3r closed 3 years ago

ggordn3r commented 3 years ago

Thanks for the useful package. I am a TA for a statistics in R class and frequently use corrplot in class examples and encourage students to use it in their assignments.

One issue we often encounter is that data labels may be too long to fit comfortably on the diagonal. When this happens, we are forced to rename all of them (time-consuming and often a waste of time since we may decide to drop highly correlated variables in the next step) or exclude them from the plot with tl.pos = "n", which results in a lot of scrolling/looking up variable names in the dataframe.

A tl.pos = "l" argument (i.e. label position left-only) would solve this issue for me and my students.

Here is a screenshot of a recent example where I use corrplot to plot a Kaggle open dataset. The text is set at cex = 0.1. Assignment 3 - PCA_EFA on Household Data _ Kaggle

taiyun commented 3 years ago

Good suggestion.

This feature will be in the next version.

taiyun commented 3 years ago

Already in version 0.91 @ggordn3r

ggordn3r commented 3 years ago

Thanks @taiyun. FYI, that feature is undocumented on CRAN:

tl.pos is for the position of text labels. It is character or logical. If character, it must be one of 'lt', 'ld', 'td', 'd' or 'n'. ~ https://cran.r-project.org/web/packages/corrplot/vignettes/corrplot-intro.html

taiyun commented 3 years ago

@ggordn3r See here https://taiyun.github.io/corrplot/

I will submit v0.92 to CRAN later.