I am new to Shiny and trying to do the following- I have a csv file which has two columns- ID and name. On the ui side, the user can enter an ID (textInput). On the server side, I am reading in the csv file as a dataframe and based on the user-defined textInput, I am subsetting the dataframe. I want to present the resulting dataframe (after subsetting) as another user input with a checkbox next to each row. I don't know where to start.
ui <- fluidPage(
useShinyjs(), #include shinyjs
# Application title
titlePanel(fluidRow(
column(3, " ADVANCE DATA RETRIEVAL",align="center"),
column(2, offset = 0,img(height =90,width=250,src="logo.png",align="left"))
)),
sidebarLayout(sidebarPanel(width = 5,
helpText("Please enter a station ID."),textInput("stationID", "IDs", value = ""),
actionBttn("goButton","Go!",color = "default",style = "fill",size = "lg")),
mainPanel(width = 6,tableOutput("results"))))
server <- function(input, output, session) {
TS_metadata<-eventReactive(input$goButton,{
PRECIP<-read.csv("Precip.csv", header = TRUE)
Subset_Precip<-subset(PRECIP, PRECIP$ID==input$stationID)
)}
}
PRECIP.csv look like-
If input$stationID = 17517 then the resulting dataframe has the first two rows and I want the dataframe (with two rows) to appear as a user input where each row has a checkbox next to it. I have presented here a few lines of the code to give an idea as to what I am trying to do. Any help is greatly appreciated. Thanks.