Corregir bug, en cada panel salía misma y.

This commit is contained in:
2023-01-24 15:06:15 +01:00
parent cde38f8aa6
commit c1bd92a7c9
+8
View File
@@ -69,6 +69,14 @@ ggstats_add_xy<-function(table_stat, table, xcol=NULL, group, y="max", bracket.o
by=diff(range(table[,value.var], na.rm = T))*bracket.inspace) by=diff(range(table[,value.var], na.rm = T))*bracket.inspace)
} }
} }
}else{
for (dia in unique(pull(table_stat,all_of(exclude_group)))){
t[table_stat[,exclude_group] == dia, "y.position"]<-seq(t[table_stat[,exclude_group] == dia,"y.position"][[1,1]],
t[table_stat[,exclude_group] == dia,"y.position"][[1,1]]+
diff(range(table[,value.var], na.rm = T))*
bracket.inspace*(nrow(table_stat[table_stat[,exclude_group] == dia,])-1),
by=diff(range(table[,value.var], na.rm = T))*bracket.inspace)
}
} }
return(cbind(table_stat,t) %>% as_tibble) return(cbind(table_stat,t) %>% as_tibble)
} }