SHARE
TWEET

Untitled

a guest Mar 7th, 2015 59 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #Installieren und Laden der benötigten Packages
  2.  
  3. if (!require("gplots")) {
  4.    install.packages("gplots", dependencies = TRUE)
  5.    library(gplots)
  6.    }
  7. if (!require("RColorBrewer")) {
  8.    install.packages("RColorBrewer", dependencies = TRUE)
  9.    library(RColorBrewer)
  10.    }
  11.  
  12. #Daten einlesen und Matrix generieren
  13.  
  14. data <- read.csv("Downloads/distribution.csv")
  15. rnames <- beitraege[,1]                            
  16. mat_data <- data.matrix(beitraege[,2:ncol(beitraege)])
  17. rownames(mat_data) <- rnames                  
  18.  
  19. #Anpassen und Plotten der Heatmap
  20.  
  21. my_palette <- colorRampPalette(c("green", "yellow", "red"))(n = 299)
  22.  
  23. col_breaks = c(seq(0,750,length=100),  
  24.   seq(750,2000,length=100),              
  25.   seq(2000,3000,length=100))              
  26.  
  27. png("Downloads//test.png",  
  28.   width = 10*300,        
  29.   height = 10*300,
  30.   res = 300,            
  31.   pointsize = 9)      
  32.  
  33. heatmap.2(mat_data,
  34.   cellnote = mat_data,  
  35.   main = "Correlation",
  36.   notecol="black",      
  37.   density.info="none",  
  38.   trace="none",        
  39.   margins =c(12,9),    
  40.   col=my_palette,      
  41.   breaks=col_breaks,    
  42.   dendrogram="row",    
  43.   Colv="NA")            
  44.  
  45. dev.off()
RAW Paste Data
Top