Cambiar la forma de ordenar los ejes.

This commit is contained in:
2022-02-05 07:54:08 +01:00
parent 5d9fec1c62
commit 2a78288451
+3 -2
View File
@@ -14,10 +14,11 @@ ggheatmap<-function(df, x=NULL, y=NULL, value=NULL, grouping="mean"){
order<-clustsort(df %>% spread(VarY,Value) %>% as.data.frame)
df$VarX<-factor(df$VarX, levels=order$x)
df$VarY<-factor(df$VarY, levels=order$y)
df %>%
ggplot(aes(VarX, VarY, fill=Value))+
scale_x_discrete(limits=order$x)+
scale_y_discrete(limits=order$y)+
labs(x=x, y=y)+
theme_heatmap()
}