Browse Source

Corrección error en el orden del escalado.

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

+ 3
- 3
R/ggheatmap.R

@ -17,9 +17,6 @@ ggheatmap<-function(df, x=NULL, y=NULL, value=NULL, grouping="mean", exclude_gro
df<-df %>% summarise(Value=median(Value)) %>% ungroup df<-df %>% summarise(Value=median(Value)) %>% ungroup
} }
order<-clustsort(df %>% spread(VarY,Value) %>% select(!all_of(exclude_group)) %>% as.data.frame) order<-clustsort(df %>% spread(VarY,Value) %>% select(!all_of(exclude_group)) %>% as.data.frame)
df$VarX<-factor(df$VarX, levels=order$x)
df$VarY<-factor(df$VarY, levels=order$y)
if (scale != "none"){ if (scale != "none"){
if (scale == "rows"){ if (scale == "rows"){
@ -36,6 +33,9 @@ ggheatmap<-function(df, x=NULL, y=NULL, value=NULL, grouping="mean", exclude_gro
} }
} }
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))+
labs(x=x, y=y)+ labs(x=x, y=y)+

Loading…
Cancel
Save