Browse Source

Añadir sistemas medida

master
marcelcosta 4 years ago
parent
commit
42671bba02
1 changed files with 10 additions and 3 deletions
  1. +10
    -3
      invivos/app.R

+ 10
- 3
invivos/app.R

@ -13,6 +13,7 @@ ui <- fluidPage(
tabPanel("Diseño", tabPanel("Diseño",
sidebarPanel( sidebarPanel(
fileInput(inputId = "file_sizes", label = "Hoja de tamaños", multiple = F), 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), sliderInput("ncages", "Cajas", min=1, max=10, value=1),
downloadButton("downloadData", "Descargar Excel") downloadButton("downloadData", "Descargar Excel")
) )
@ -42,10 +43,16 @@ server <- function(input, output) {
template["Group"]<-"" template["Group"]<-""
template<-rbind(template, template, template) template<-rbind(template, template, template)
template<-template[order(template$Timepoint, template$Cage, template$`ID animal`, template$`ID tumor`),] 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)]<-"" dtemplate[,6:ncol(dtemplate)]<-""
print(dtemplate)
write.xlsx(dtemplate,file) write.xlsx(dtemplate,file)
} }
) )

Loading…
Cancel
Save