diff --git a/invivos/app.R b/invivos/app.R index 53aed5a..63eea6e 100755 --- a/invivos/app.R +++ b/invivos/app.R @@ -474,7 +474,8 @@ server <- function(input, output) { }else{ tableR<-table %>% filter(!is.na(Volume)) - endtime<-dcast(tableR, `ID animal`+`ID tumor`+Group~., value.var = "Timepoint", fun.aggregate = function(x){max(as.numeric(as.character(x)))}) %>% rename("end"=".") + endtime<-dcast(if(length(unique(tableR$Timepoint)) > 1){tableR %>% filter(Volume < input$cutoff)}else{tableR}, `ID animal`+`ID tumor`+Group~., + value.var = "Timepoint", fun.aggregate = function(x){max(as.numeric(as.character(x)))}) %>% rename("end"=".") endtime["Dead"]<-dcast(tableR, `ID animal`+`ID tumor`+Group~., value.var = "Volume", fun.aggregate = function(x){max(as.numeric(as.character(x)))}) %>% pull(".") >= input$cutoff table_tumor<<-endtime