diff --git a/invivos/app.R b/invivos/app.R index 750ba67..90a1b95 100755 --- a/invivos/app.R +++ b/invivos/app.R @@ -13,6 +13,7 @@ ui <- fluidPage( tabPanel("Diseño", sidebarPanel( fileInput(inputId = "file_sizes", label = "Hoja de tamaños", multiple = F), + selectInput(inputId = "measure_sys", "Sistema de medida", selected = "L-W-D", choices = c("L-W-D","Min-Max","Absorbance")), sliderInput("ncages", "Cajas", min=1, max=10, value=1), downloadButton("downloadData", "Descargar Excel") ) @@ -42,10 +43,16 @@ server <- function(input, output) { template["Group"]<-"" template<-rbind(template, template, template) template<-template[order(template$Timepoint, template$Cage, template$`ID animal`, template$`ID tumor`),] - template["TS"]<-rep(c("TS-Length", "TS-Width", "TS-Deep"), nrow(template)/3) - dtemplate<-dcast(template, Cage+`ID animal`+`ID tumor`+Group+TS~Timepoint) + if (input$measure_sys == "L-W-D"){ + template["TS"]<-rep(c("TS-Length", "TS-Width", "TS-Deep"), nrow(template)/3) + dtemplate<-dcast(template, Cage+`ID animal`+`ID tumor`+Group+TS~Timepoint) + } + if (input$measure_sys == "Min-Max"){ + template["DPV"]<-rep(c("Major", "Minor"), nrow(template)/2) + dtemplate<-dcast(template, Cage+`ID animal`+`ID tumor`+Group+DPV~Timepoint) + } + dtemplate[,6:ncol(dtemplate)]<-"" - print(dtemplate) write.xlsx(dtemplate,file) } )