Browse Source

1a Versión del programa.

main
marcelcosta 1 year ago
parent
commit
18bb3e75f3
1 changed files with 39 additions and 5 deletions
  1. +39
    -5
      Nitrogen/app.R

+ 39
- 5
Nitrogen/app.R

@ -1,4 +1,8 @@
library(shiny) library(shiny)
library(readxl)
library(DT)
file<-"V:/LBM/VIROTERAPIA I TERAPIA GENICA/Lola/Proyecto Idibell UM - Lola/Documentacion ensayo clinico PULSE laboratorio/PULSE MUESTRAS -80.xlsx"
ui <- fluidPage( ui <- fluidPage(
@ -8,20 +12,50 @@ ui <- fluidPage(
# Sidebar # Sidebar
sidebarLayout( sidebarLayout(
sidebarPanel( sidebarPanel(
fileInput(inputId = "excel", label = "Cargar Cajas", multiple = F)
), ),
mainPanel( mainPanel(
DTOutput("DT_ab")
) )
) )
) )
server <- function(input, output) { server <- function(input, output) {
output$distPlot <- renderPlot({
})
nitro<-reactiveValues()
nitro$db<-NULL
observe({
if (!is.null(input$excel)){
sheets<-excel_sheets(input$excel$datapath)
table<-read_xlsx(input$excel$datapath, sheet = 1) %>%
add_column("Caja"=sheets[1]) %>%
gather(Columna, Vial, -1, -Caja) %>%
rename("Fila"="...1")
if (length(sheets) > 1){
for (i in 2:length(sheets)){
table<-rbind(
table,
read_xlsx(input$excel$datapath, sheet = i) %>%
add_column("Caja"=sheets[i]) %>%
gather(Columna, Vial, -1, -Caja) %>%
rename("Fila"="...1")
)
}
}
table<-table[,c("Caja","Fila","Columna","Vial")]
nitro$db<-table
}
})
output$DT_ab <- renderDT({
table<-nitro$db
datatable(table, filter = "bottom", rownames = F, escape = F, extensions='Buttons',options = list(autoWidth=TRUE, dom = 'Bfrtip',buttons=I('colvis'), lengthMenu=c(10,20,50), pageLength=20, columnDefs=list(list("visible"=F,"targets"=match("Etiqueta",colnames(table))-1))))
})
} }
# Run the application # Run the application

Loading…
Cancel
Save