ifelse function returns vector of length equal to the length of condition. Default is "diag = TRUE", which has length one, hence the diagonal is effectively replaced by its first element when constructing the colour scale via corr_tmp. This PR fixes it so the whole diagonal is preserved.
The following code illustrates the problem - compare the colour scales of these plots, the second one is correct, but the first one is not:
ifelse function returns vector of length equal to the length of condition. Default is "diag = TRUE", which has length one, hence the diagonal is effectively replaced by its first element when constructing the colour scale via corr_tmp. This PR fixes it so the whole diagonal is preserved.
The following code illustrates the problem - compare the colour scales of these plots, the second one is correct, but the first one is not: