Here are the data:
set.seed(123) mat <- matrix(rnorm(5000, 0.5, 0.2), 50) heatmap (mat)
mat[mat > 0.05] <- NA heatmap (mat) Error in hclustfun(distfun(x)) : NA/NaN/Inf in foreign function call (arg 11)
Replacing it with other values ββ(it can optionally help), but it can deceive readers, because it will choose a color from the same scale, which is wrong. Therefore, I want to set a completely different color for those values ββthat exceed 0.05.
mat[mat > 0.05] <- 0.1 heatmap (mat)
source share