In R function pheatmap::pheatmap
, is it possible to adjust the gap distances?
In the following example, I created a gap in columns 3 and 4 using parameter gaps_col=3
. Yet, the gap is too small visually. I wonder if there is a way to adjust the gap size? At this moment, I do not consider using other packages.
# Create test matrix
test = matrix(rnorm(200), 20, 10)
test[1:10, seq(1, 10, 2)] = test[1:10, seq(1, 10, 2)] + 3
test[11:20, seq(2, 10, 2)] = test[11:20, seq(2, 10, 2)] + 2
test[15:20, seq(2, 10, 2)] = test[15:20, seq(2, 10, 2)] + 4
colnames(test) = paste("Test", 1:10, sep = "")
rownames(test) = paste("Gene", 1:20, sep = "")
# Draw heatmaps
pheatmap(test, cluster_cols = F, gaps_col = 3) # creating gap using gaps_col.