From d9a5689c995a11cb35e0876c9f2f90c3b619a7fc Mon Sep 17 00:00:00 2001 From: marcelcosta Date: Tue, 12 Dec 2023 17:31:18 +0100 Subject: [PATCH] =?UTF-8?q?Correcci=C3=B3n=20bug=20operados.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- invivos/app.R | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/invivos/app.R b/invivos/app.R index 4091f45..f283a19 100755 --- a/invivos/app.R +++ b/invivos/app.R @@ -439,6 +439,7 @@ server <- function(input, output) { table %>% group_by(Group, DayPostInoc, Side) %>% count() %>% spread(DayPostInoc, n) } }) + output$cin_group<-renderPlot({ if (!is.null(input$file_analy) & !is.null(analysis$taula)){ observeEvent(analysis$taula, {}) @@ -469,7 +470,7 @@ server <- function(input, output) { deadmice<-filter(table, !is.na(substr(Observations,1,1)) & substr(Observations,1,1) == "+") %>% pull(Animal) print(deadmice) - if (input$operated == TRUE){ + if (input$operated == TRUE & nrow(firstoper) > 0){ for (i in 1:nrow(firstoper)){ table<-table %>% filter(DayPostInoc < firstoper$FirstOper[i] | Side != firstoper$Side[i]) } @@ -478,7 +479,7 @@ server <- function(input, output) { table<-table %>% filter(!Animal %in% deadmice) } } - + ggplot(table, aes(DayPostInoc, Volume, color=Group, group=Group))+ geom_errorbar(stat="summary", width=0.05)+ geom_line(stat="summary")+ @@ -487,14 +488,14 @@ server <- function(input, output) { labs(x="Days after tumor inoculation")+ scale_y_continuous(expand = expansion(mult = c(0,0.05)))+ scale_x_continuous(expand = expansion(mult = c(0,0.05)), limits = c(0, (round(max(table$DayPostInoc) / 5)+1)*5))+ - theme_bw() + 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 (input$operated == TRUE){ + if (input$operated == TRUE & nrow(firstoper) > 0){ table<-table %>% filter(DayPostInoc < firstoper) }else{ deadmice<-filter(table, !is.na(substr(Observations,1,1)) & substr(Observations,1,1) == "+") %>% @@ -542,7 +543,7 @@ server <- function(input, output) { 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){ + if (input$operated == TRUE & nrow(firstoper) > 0){ for (i in 1:nrow(firstoper)){ table<-table %>% filter(DayPostInoc < firstoper$FirstOper[i] | Side != firstoper$Side[i]) } @@ -567,7 +568,7 @@ server <- function(input, output) { pull(DayPostInoc) %>% min(na.rm = T) print(firstoper) - if (input$operated == TRUE){ + if (input$operated == TRUE & nrow(firstoper) > 0){ table<-table %>% filter(DayPostInoc < firstoper) }else{ deadmice<-filter(table, !is.na(substr(Observations,1,1)) & substr(Observations,1,1) == "+") %>% @@ -598,7 +599,7 @@ server <- function(input, output) { 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){ + if (input$operated == TRUE & nrow(firstoper) > 0){ for (i in 1:nrow(firstoper)){ table<-table %>% filter(DayPostInoc < firstoper$FirstOper[i] | Side != firstoper$Side[i]) } @@ -639,7 +640,7 @@ server <- function(input, output) { pull(DayPostInoc) %>% min(na.rm = T) print(firstoper) - if (input$operated == TRUE){ + if (input$operated == TRUE & nrow(firstoper) > 0){ table<-table %>% filter(DayPostInoc < firstoper) }else{ deadmice<-filter(table, !is.na(substr(Observations,1,1)) & substr(Observations,1,1) == "+") %>%