diff --git a/invivos/app.R b/invivos/app.R index e16b675..b967cf8 100755 --- a/invivos/app.R +++ b/invivos/app.R @@ -493,12 +493,12 @@ server <- function(input, output) { scale_x_continuous(expand = expansion(mult = c(0,0.05)), limits = c(0, (round(max(table$DayPostInoc) / 5)+1)*5))+ theme_bw() }else{ - + firstoper<- filter(table, !is.na(substr(Observations,1,1)) & substr(Observations,1,1) == "*") %>% pull(DayPostInoc) %>% min(na.rm = T) - print(firstoper) + if (firstoper == Inf){firstoper<-c()} - if (input$operated == TRUE & nrow(firstoper) > 0){ + if (input$operated == TRUE & length(firstoper) > 0){ table<-table %>% filter(DayPostInoc < firstoper) }else{ deadmice<-filter(table, !is.na(substr(Observations,1,1)) & substr(Observations,1,1) == "+") %>% @@ -569,9 +569,9 @@ server <- function(input, output) { }else{ firstoper<- filter(table, !is.na(substr(Observations,1,1)) & substr(Observations,1,1) == "*") %>% pull(DayPostInoc) %>% min(na.rm = T) - print(firstoper) + if (firstoper == Inf){firstoper<-c()} - if (input$operated == TRUE & nrow(firstoper) > 0){ + if (input$operated == TRUE & length(firstoper) > 0){ table<-table %>% filter(DayPostInoc < firstoper) }else{ deadmice<-filter(table, !is.na(substr(Observations,1,1)) & substr(Observations,1,1) == "+") %>% @@ -601,8 +601,9 @@ server <- function(input, output) { if (input$vacc == "Sí"){ firstoper<- filter(table, !is.na(substr(Observations,1,1)) & substr(Observations,1,1) == "*") %>% select(DayPostInoc, Side) %>% unique() %>% - group_by(Side) %>% summarise(FirstOper=min(DayPostInoc)) - if (input$operated == TRUE & nrow(firstoper) > 0){ + if (firstoper == Inf){firstoper<-c()} + + if (input$operated == TRUE & length(firstoper) > 0){ for (i in 1:nrow(firstoper)){ table<-table %>% filter(DayPostInoc < firstoper$FirstOper[i] | Side != firstoper$Side[i]) }