Browse Source

Cambio de formato para cinética de grupo.

master
marcelcosta 1 year ago
parent
commit
5ab5ab4445
1 changed files with 25 additions and 8 deletions
  1. +25
    -8
      invivos/app.R

+ 25
- 8
invivos/app.R

@ -387,22 +387,39 @@ server <- function(input, output) {
} }
}) })
output$cin_group<-renderPlot({ 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í"){ 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_errorbar(stat="summary", width=0.05)+
geom_line(stat="summary")+ geom_line(stat="summary")+
geom_point(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_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() theme_bw()
}else{ }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_errorbar(stat="summary",width=0.05)+
geom_line(stat="summary")+ geom_line(stat="summary")+
geom_point(stat="summary")+ geom_point(stat="summary")+

Loading…
Cancel
Save