Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to use corrplot with is.corr=FALSE

Tags:

r

r-corrplot

I previously made a beautiful functional and perfect actual corrolation plot with corrplot (my plot). Now I have to get the underlying data in the same look. So my goal is to have triangular similarity matrixes in the same colours as my corrolation plot. Imagine it like the conditional formatting in excel.

My Data: my Data from excel

Link to CSV Data file

it is loaded in as a csv and it can read the csv perfectly

My Code:corrplot(Phylogeny, is.corr=FALSE,method="number", cl.lim=c(0,1))

The error it throws me: Error in if (any(corr < cl.lim[1]) || any(corr > cl.lim[2])) { : Missing value, where TRUE/FALSE is required

  • i made sure all colums are numeric
  • i made sure to fill the missing bits with NA's (because that was a problem somwhere before)
  • i made sure all my values are between 0 and 1 like i want the limit to be (in between it told me that my values are not within the limit, when i tried around with some stuff)
  • the error does not change when i change the limit
  • the error does not change when i take the is.corr=FALSE out (default=TRUE)
  • i played around with corrplot.mixed and its still not working
  • have been referencing information from Corrplot Intro

I have looked into the condformat function but i am not really sure if it can do a filling of each cell with one colour according to the overall gradient like i used for my corrolation plot.

What am I missing here that it does not want to give me my table back with pretty colours?

like image 578
NonoVirus Avatar asked Mar 13 '26 05:03

NonoVirus


1 Answers

I had the same error, but I was able to fix it by converting my data.frame to a matrix. I ended up with corrplot(as.matrix(df), is.corr = FALSE).

like image 167
user9536160 Avatar answered Mar 15 '26 17:03

user9536160



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!