Norm.data <- read.csv("Z:/Data/Lung data/somdataT-norm-ig2b-TD.csv")Turn it into a data matrix using
Norm.data <- na.omit(Norm.data)
Norm.data.m<- (data.matrix(Norm.data))But there are not character row names?! I found two duplicate entries that may have caused errors in doing this and assigned them unique names. But I still got the error. Try setting names using this
rownames(Norm.data) <- Norm.data[ ,1]Simpler to use this function in one line (and works)
Norm.data.rn.m <- data.frame(Norm.data[,-1], row.names=Norm.data[,1])Now I can finally apply the simple version of heatmap to view the data:
Norm.data.m<- (data.matrix(Norm.data.rn.m))
heatmap(Norm.data.m)
To look at only a subset of the data for the patients with overlapping data:
Norm.data.OL <- subset(Norm.data.m, select=c(2,4:8))
heatmap(Norm.data.OL)
Other notes:
I am using the subset function to select parts of the data.
x <- subset(somdataT, select = c(4:28))
gene <- subset(somdataT, select =c(2))
This can also be used conditionally to select above background
somdat.bkgrd <- subset(somdataT, pt5>350, select = c(pt5,pt8))
No comments:
Post a Comment