From 42671bba02d6e0de6fcc63650f4939e01d895b2b Mon Sep 17 00:00:00 2001 From: marcelcosta Date: Tue, 3 Nov 2020 18:34:35 +0100 Subject: [PATCH] =?UTF-8?q?A=C3=B1adir=20sistemas=20medida?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- invivos/app.R | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) 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) } )