taiyun / corrplot

A visual exploratory tool on correlation matrix

Home Page:https://github.com/taiyun/corrplot

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

ggordn3r opened this issue · comments

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

Good suggestion.

This feature will be in the next version.

Already in version 0.91 @ggordn3r

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

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

I will submit v0.92 to CRAN later.