From 5ab5ab4445705ffaaaee8324c5d7a316313f623e Mon Sep 17 00:00:00 2001 From: marcelcosta Date: Fri, 27 Jan 2023 14:27:33 +0100 Subject: [PATCH] =?UTF-8?q?Cambio=20de=20formato=20para=20cin=C3=A9tica=20?= =?UTF-8?q?de=20grupo.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- invivos/app.R | 33 +++++++++++++++++++++++++-------- 1 file changed, 25 insertions(+), 8 deletions(-) diff --git a/invivos/app.R b/invivos/app.R index c848b97..b3af629 100755 --- a/invivos/app.R +++ b/invivos/app.R @@ -387,22 +387,39 @@ server <- function(input, output) { } }) output$cin_group<-renderPlot({ - if (!is.null(input$file_analy) & !is.null(analysis$taula_def)){ - observeEvent(analysis$taula_def, {}) - table<-analysis$taula_def + if (!is.null(input$file_analy) & !is.null(analysis$taula)){ + observeEvent(analysis$taula, {}) + table<-analysis$taula + animals<-unique(table$Animal) + sides<-unique(table$Side) + groups<-table %>% select(Animal, Group) %>% unique() %>% pull(Group) + basal<-data.frame( + Cage="", + Animal=rep(animals, each=length(sides)), + Date="", + DayPostInoc=0, + Group=rep(groups, each=length(sides)), + Side=rep(sides, length(animals)), + Weight="", + Long="", + Wide="", + Volume=0, + Observations="" + ) + table<-rbind(table, basal) if (input$vacc == "Sí"){ - ggplot(table, aes(as.numeric(as.character(Timepoint)), Volume, color=Group, group=Group))+ + ggplot(table, aes(DayPostInoc, Volume, color=Group, group=Group))+ geom_errorbar(stat="summary", width=0.05)+ geom_line(stat="summary")+ geom_point(stat="summary")+ - facet_grid(factor(`ID tumor`, labels = c("Vaccination", "Rechallenge"))~., scale="free_y")+ - labs(x="Days after tumor challenge")+ + facet_grid(factor(Side, labels = c("Vaccination", "Rechallenge"))~., scale="free_y")+ + 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(as.numeric(as.character(table$Timepoint))) / 5)+1)*5))+ + scale_x_continuous(expand = expansion(mult = c(0,0.05)), limits = c(0, (round(max(table$DayPostInoc) / 5)+1)*5))+ theme_bw() }else{ - ggplot(table, aes(Timepoint, Volume, color=Group, group=Group))+ + ggplot(table, aes(DayPostInoc, Volume, color=Group, group=Group))+ geom_errorbar(stat="summary",width=0.05)+ geom_line(stat="summary")+ geom_point(stat="summary")+