|
@ -14,10 +14,11 @@ ggheatmap<-function(df, x=NULL, y=NULL, value=NULL, grouping="mean"){ |
|
|
|
|
|
|
|
|
order<-clustsort(df %>% spread(VarY,Value) %>% as.data.frame) |
|
|
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 %>% |
|
|
df %>% |
|
|
ggplot(aes(VarX, VarY, fill=Value))+ |
|
|
ggplot(aes(VarX, VarY, fill=Value))+ |
|
|
scale_x_discrete(limits=order$x)+ |
|
|
|
|
|
scale_y_discrete(limits=order$y)+ |
|
|
|
|
|
labs(x=x, y=y)+ |
|
|
labs(x=x, y=y)+ |
|
|
theme_heatmap() |
|
|
theme_heatmap() |
|
|
} |
|
|
} |