From dde77d987c935aca69147252cc771d2b8d35bab6 Mon Sep 17 00:00:00 2001 From: marcelcosta Date: Fri, 27 Jan 2023 15:20:05 +0100 Subject: [PATCH] Autocompletado de grupo. --- invivos/app.R | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/invivos/app.R b/invivos/app.R index a3b3ec0..d5c28d8 100755 --- a/invivos/app.R +++ b/invivos/app.R @@ -356,6 +356,19 @@ server <- function(input, output) { wide<-as.numeric(strsplit(table[i,"Wide"],"+", fixed = T)[[1]]) table[i,"Volume"]<-sum(sapply(1:length(long), function(x) (long[x]*wide[x]*wide[x])*(pi/6))) } + + ## Autocompletado de grupo + table_group<-merge( + table %>% select(Animal, Group) %>% unique() %>% group_by(Animal) %>% count(), + table %>% select(Animal, Group) %>% unique() + ) %>% filter(n > 1 & (!is.na(Group) | Group != "")) %>% select(-n) + + table<-merge( + table %>% select(-Group), + table_group + ) %>% relocate(Group, .after = DayPostInoc) %>% arrange(DayPostInoc, Animal, Side) + + analysis$taula<-table } })