sorry for the basic question, but I couldn't find an answer that worked googling elsewhere. I am having trouble running the pheatmap() function in R on a 411 x 341 table with the following format extended to 341 samples and 411 genes:
| Sample_1 | Sample_2 | Sample_3 | Sample_4 | |
|---|---|---|---|---|
| Gene1 | 1.22 | 3.21 | 4.20 | 1.08 |
| Gene2 | 1.34 | 1.09 | 0.69 | 1.02 |
| Gene2 | 1.34 | 0.80 | 0.81 | 3.51 |
| Gene2 | 1.34 | 2.21 | 0.97 | 1.12 |
When I run the following code:
library(readxl)
library(pheatmap)
library(grid)
library(gtable)
setwd("~/Analysis")
Data <- read_excel("mRNA_Expression.xlsx", sheet = "P")
Data <- as.matrix(Data)
Data2 <- Data[,-1]
rownames(Data2) <- Data[,1]
pheatmap(Data2, cluster_rows = T, cluster_cols = F, legend = T)
I get the error
Error in cut.default(x, breaks = breaks, include.lowest = T) :
'x' must be numeric
I can't seem to figure out what is causing it. As bet I understand, the cut function is related to clustering, but even if I run the code as simply:
pheatmap(Data2, cluster_rows = F, cluster_cols = F, legend = F)
I still get the error. Any suggestions on how to fix this issue? Thanks in advance!