Desgrupar después de centralizar.
This commit is contained in:
+2
-2
@@ -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))
|
||||
|
||||
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"){
|
||||
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)
|
||||
|
||||
Reference in New Issue
Block a user