Browse Source

Cambiar la forma de ordenar los ejes.

main
Marcel Costa 2 years ago
parent
commit
2a78288451
1 changed files with 3 additions and 2 deletions
  1. +3
    -2
      R/ggheatmap.R

+ 3
- 2
R/ggheatmap.R

@ -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()
} }

Loading…
Cancel
Save