I'm following the tutorial to make circular plots in R. Suppose I have this dataset:
set.seed(123)
mat1 = rbind(cbind(matrix(rnorm(50*5, mean = 1), nr = 50),
matrix(rnorm(50*5, mean = -1), nr = 50)),
cbind(matrix(rnorm(50*5, mean = -1), nr = 50),
matrix(rnorm(50*5, mean = 1), nr = 50))
)
rownames(mat1) = paste0("R", 1:100)
colnames(mat1) = paste0("C", 1:10)
mat1 = mat1[sample(100, 100), ] # randomly permute rows
split = sample(letters[1:5], 100, replace = TRUE)
split = factor(split, levels = letters[1:5])
I tried using Heatmap
and it returns appropriately.
library(ComplexHeatmap)
Heatmap(mat1, row_split = split)
However, when I try to use circos.heatmap()
, it returns error:
library(circlize)
col_fun1 = colorRamp2(c(-2, 0, 2), c("blue", "white", "red"))
circos.heatmap(mat = mat1, split = split, col = col_fun1)
circos.heatmap(mat = mat1, col = col_fun1)
> Error in rowMeans(m) : 'x' must be an array of at least two dimensions
The matrix itself has a dimension of 100 x 10. Is there anything I'm missing?