Corrección error en el orden del escalado.

This commit is contained in:
2022-02-05 16:51:31 +01:00
parent eeba7ea855
commit a2d10b2308
+3 -3
View File
@@ -18,9 +18,6 @@ ggheatmap<-function(df, x=NULL, y=NULL, value=NULL, grouping="mean", exclude_gro
}
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 == "rows"){
cols<-unique(df$VarY)
@@ -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 %>%
ggplot(aes(VarX, VarY, fill=Value))+
labs(x=x, y=y)+