Browse Source

Desgrupar después de centralizar.

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

+ 2
- 2
R/ggheatmap.R

@ -6,10 +6,10 @@ ggheatmap<-function(df, x=NULL, y=NULL, value=NULL, grouping="mean"){
df<-rename(df, "VarX"=all_of(x), "VarY"=all_of(y), "Value"=all_of(value)) df<-rename(df, "VarX"=all_of(x), "VarY"=all_of(y), "Value"=all_of(value))
if (grouping == "mean"){ if (grouping == "mean"){
df<-df %>% group_by(VarX,VarY) %>% summarise(Value=mean(Value))
df<-df %>% group_by(VarX,VarY) %>% summarise(Value=mean(Value)) %>% ungroup
} }
if (grouping == "median"){ if (grouping == "median"){
df<-df %>% group_by(VarX,VarY) %>% summarise(Value=median(Value))
df<-df %>% group_by(VarX,VarY) %>% summarise(Value=median(Value)) %>% ungroup
} }
order<-clustsort(df %>% spread(VarY,Value) %>% as.data.frame) order<-clustsort(df %>% spread(VarY,Value) %>% as.data.frame)

Loading…
Cancel
Save