My shiny app looks as follows so far (extract):
ui <- fluidPage(
headerPanel("title"),
sidebarLayout(
sidebarPanel(
h4("header"),
tags$hr(),
# Input: Bilanzpositionen Passiv ----
fileInput("file1", "Kollektive hochladen",
multiple = TRUE,
accept = c("text/csv",
"text/comma-separated-values,text/plain",
".csv")),
)
)
)
# # # # #
server <- function(input, output) {
output$contents <- renderTable({
req(input$file1)
bipop <- read.csv(input$file1$datapath,
sep = input$sep,
quote = input$quote)
if(input$disp == "head") {
return(head(bipop))
}
else {
bipop
}
})
}
Later on in code (server) I want to extract some data from the Input "bipop" to create some new tables which shall be part of another output.
My trial
monate <- bipop[,4]
doesn't work: "Error: ... undefined columns selected..." and "Error: object ... not found"
How can I define the variable "bipop" as global, so that I can use it outside of the code from "output"?
Thanks.