r - How to save the elements of x and y axis on the heatmap? -
i generated heapmap using glpots this.
head(test) # go.0000041 go.0001505 ... #go:0002479 0.053 0.061 ... ... heatmap.2(test, trace="none", density.info="none", col=colfunc(15))
what want take elements of x , y label clustered on heatmap , save text file. is, go:0042164..... many help!
first of all, when post question involving plotting, it's extremely helpful if provide minimal, reproducible example. otherwise it's difficult give specific coding suggestions or make person answering question unnecessary work. i'll try saved time taking example ?heatmap.2
page
data(mtcars) x <- as.matrix(mtcars) library(gplots) xx <- heatmap.2(x)
here make sure save results of plotting command variable. stores dendrograms rows , columns. can @ labels with
head(finalrownames<-labels(xx$rowdendrogram)) # [1] "maserati bora" "chrysler imperial" "lincoln continental" # [4] "cadillac fleetwood" "hornet sportabout" "pontiac firebird" head(finalcolnames<-labels(xx$coldendrogram)) # [1] "cyl" "am" "vs" "carb" "wt" "drat"
here took head()
keep output minimal length.
Comments
Post a Comment