I am trying to generate heatmap and dendogram from a datset. Below is the code I have written:
importdata=read.csv("c//sourav//Desktop//sourav.csv") newscore=spread(importdata,ga.relatedProductId,ga.correlationScore) install.packages("dplyr") library(dplyr) newscore[is.na(newscore)]=1 row.names(newscore)=newscore$ga.queryProductId newscore=newscore[,c(-1,-2)] heatmap(as.matrix(newscore),scale="none")
Everything is working fine. But, when I am using heatmap function, I am getting an error
"error in heatmap(as.matrix(newscore), scale = "none") : 'x' must be a numeric matrix.
though inside heatmap function I have converted newscore variable to as.matrix but why it is generating error?
Can any body help me out. It is very frustrating that in the last line, it is giving error. If anybody really want to help me out I will send him/her data.
Please help me out.