Browse Source

Funcionalidad "incremento de volumen".

master
marcelcosta 10 months ago
parent
commit
cda5d7f881
1 changed files with 15 additions and 9 deletions
  1. +15
    -9
      invivos/app.R

+ 15
- 9
invivos/app.R

@ -411,7 +411,21 @@ server <- function(input, output) {
table$Group<-factor(table$Group, levels=levels) table$Group<-factor(table$Group, levels=levels)
table<-filter(table, !is.na(Group)) table<-filter(table, !is.na(Group))
}else(table$Group<-factor(table$Group)) }else(table$Group<-factor(table$Group))
print(str(table))
if (input$increase_volume){
cols<-colnames(table)
timepoints<-unique(table$DayPostInoc)
table_old<-select(table, -Volume)
table_vols<-table %>%
select(-Weight, -Date, -Long, -Wide,-Observations) %>%
spread(DayPostInoc, Volume) %>%
mutate(across(all_of(as.character(timepoints)), function(x){(x*100/`0`)-100})) %>%
gather(DayPostInoc, Volume, all_of(as.character(timepoints))) %>%
mutate(Volume=case_when(Volume < 0 ~ 0, T~Volume))
table<-merge(table_old, table_vols)[,cols]
}
analysis$taula<-table analysis$taula<-table
} }
}) })
@ -431,14 +445,6 @@ server <- function(input, output) {
table<-analysis$taula table<-analysis$taula
table<-table %>% filter(!is.na(Group)) table<-table %>% filter(!is.na(Group))
if (input$increase_volume){
timepoints<-unique(table$Timepoint)
table<-table %>% select(-Major, -Minor) %>%
spread(Timepoint, Volume) %>%
mutate(across(all_of(timepoints), function(x){(x*100/`0`)-100})) %>%
gather(Timepoint, Volume, -`ID animal`, -`ID tumor`, -Group) %>%
mutate(Volume=case_when(Volume < 0 ~ 0, T~Volume))
}
table %>% group_by(Group, DayPostInoc, Side) %>% count() %>% spread(DayPostInoc, n) table %>% group_by(Group, DayPostInoc, Side) %>% count() %>% spread(DayPostInoc, n)
} }
}) })

Loading…
Cancel
Save