Solucionar bug firstoper.

This commit is contained in:
2024-01-17 13:04:58 +01:00
parent 43776f80cb
commit 455901a1db
+7 -6
View File
@@ -496,9 +496,9 @@ server <- function(input, output) {
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])
}