Hi All,
I am creating a UI interface through shiny that will ask for a file input.
I am using the fileInput function as shown below. I am asking for a file (xml type) and then running it through my function called checker.
Then I am displaying the summary of the script running.
I had a question about how do I get the full path name from fileInput. Currently i get a temp directory. I would like the full path name so I can do some manupluations. I would like to save the file the entire directory that the file is in. I can do it using a command line command but I need the full path name.
Here are my scripts, if you had any questions feel free to ask me.
UI.R:
library(shiny)
-----------------Start-----------------------
# Define UI for dataset viewer application
shinyUI(fluidPage(
# Application title.
headerPanel("Cluster Density Checker"),
sidebarPanel(
fileInput("inputId", "Please Pick Run Completion.xml File",accept=c("XML", "text/comma-separated-values,text/plain", ".XML")),
submitButton("Run Analysis")
),
mainPanel(
h4("Summary"),
verbatimTextOutput("summary")
)
))
-----------------End-----------------------
Server.R:
source(some file with checker function)
shinyServer(function(input, output) {
output$summary = renderPrint({
if(is.null(input$inputId)) {return()}
if(!input$inputId == 0){
data.out = checker(
input$inputId$data.path)
}
})