Hi Jim,
i managed to get the output using below logic . But file-1 output and file-2 output are view-able one after the other
example :
file1
1
2
3
file2
1
2
3
but i want to view the file 1 and file 2 side by side . Please is there any solution to fix this problem let me know ?
example:
file 1 file 2
1 1
2 2
3 3
Thank Q so much.
=================================================================================
if (interactive()) {
ui <- fluidPage(
sidebarLayout(
sidebarPanel(
fileInput("file1", "Choose CSV File1",
accept = c(
"text/csv",
"text/comma-separated-values,text/plain",
".csv")
),
tags$hr(),
fileInput("file2", "Choose CSV File2",
accept = c(
"text/csv",
"text/comma-separated-values,text/plain",
".csv")
),
tags$hr(),
checkboxInput("header", "Header", TRUE)
),
mainPanel(
tableOutput("data1"),
tableOutput("data2")
)
)
)
server <- function(input, output) {
output$data1 <- renderTable({
# input$file1 will be NULL initially. After the user selects
# and uploads a file, it will be a data frame with 'name',
# 'size', 'type', and 'datapath' columns. The 'datapath'
# column will contain the local filenames where the data can
# be found.
inFile <- input$file1
if (is.null(inFile))
return(NULL)
read.csv(inFile$datapath)
})
output$data2 <- renderTable({
# input$file1 will be NULL initially. After the user selects
# and uploads a file, it will be a data frame with 'name',
# 'size', 'type', and 'datapath' columns. The 'datapath'
# column will contain the local filenames where the data can
# be found.
inFile <- input$file2
if (is.null(inFile))
return(NULL)
read.csv(inFile$datapath)
})
}
shinyApp(ui, server)
}