|
|
@ -345,7 +345,7 @@ server <- function(input, output) { |
|
|
|
observeEvent(analysis$taula_def, {}) |
|
|
|
max_val<-max(analysis$taula_def$Volume, na.rm = T) |
|
|
|
# print(max_val) |
|
|
|
sliderInput("cutoff", "Cutoff para Survival", min=0, max=round(max_val), step=round(max_val)/200, value=max_val) |
|
|
|
sliderInput("cutoff", "Cutoff para Survival", min=0, max=round(max_val, digits=2), step=round(max_val, digits=2)/200, value=max_val) |
|
|
|
} |
|
|
|
}) |
|
|
|
output$ntable<-renderTable({ |
|
|
@ -360,7 +360,7 @@ server <- function(input, output) { |
|
|
|
if ("ID.tumor" %in% colnames(table)){table<-rename(table, "ID tumor"=`ID.tumor`)} |
|
|
|
# table[table$ID.tumor == "R","0"]<-NA |
|
|
|
col_nodays<-c("ID","Code", "Cage","Group", "ID.animal","ID animal", "ID.tumor", "ID tumor", "TS","DPV", "Absorbance") |
|
|
|
if (length(grep(0, colnames(table)[!colnames(table) %in% col_nodays])) == 0){ |
|
|
|
if (length(grep(0, colnames(table)[!colnames(table) %in% col_nodays])) == 0 & input$vacc == "Sí"){ |
|
|
|
table["0"]<-0 |
|
|
|
} |
|
|
|
table<-melt(table, id=colnames(table)[colnames(table) %in% col_nodays], variable.name = "Timepoint") |
|
|
@ -474,8 +474,8 @@ server <- function(input, output) { |
|
|
|
|
|
|
|
}else{ |
|
|
|
tableR<-table %>% filter(!is.na(Volume)) |
|
|
|
endtime<-dcast(tableR %>% filter(Volume < input$cutoff), `ID animal`+Group~., value.var = "Timepoint", fun.aggregate = function(x){max(as.numeric(as.character(x)))}) %>% rename("end"=".") |
|
|
|
endtime["Dead"]<-dcast(tableR, `ID animal`+Group~., value.var = "Volume", fun.aggregate = function(x){max(as.numeric(as.character(x)))}) %>% pull(".") > input$cutoff |
|
|
|
endtime<-dcast(tableR, `ID animal`+`ID tumor`+Group~., value.var = "Timepoint", fun.aggregate = function(x){max(as.numeric(as.character(x)))}) %>% rename("end"=".") |
|
|
|
endtime["Dead"]<-dcast(tableR, `ID animal`+`ID tumor`+Group~., value.var = "Volume", fun.aggregate = function(x){max(as.numeric(as.character(x)))}) %>% pull(".") >= input$cutoff |
|
|
|
table_tumor<<-endtime |
|
|
|
|
|
|
|
g<-ggsurvplot(survfit(Surv(table_tumor$end, table_tumor$Dead) ~ table_tumor$Group, data=table_tumor), |
|
|
@ -497,7 +497,7 @@ server <- function(input, output) { |
|
|
|
table<-analysis$taula_def |
|
|
|
if (input$vacc == "No"){ |
|
|
|
table<-filter(table, !is.na(Volume)) |
|
|
|
summary(aov(Volume~Group+Timepoint+Error(`ID animal`), data=table)) |
|
|
|
summary(aov(Volume~Group+Timepoint+Error(`ID animal`+`ID tumor`), data=table)) |
|
|
|
}else{ |
|
|
|
for (side in c("L","R")){ |
|
|
|
tableR<-filter(table, `ID tumor` == side) %>% filter(!is.na(Volume)) |
|
|
|