This is
UI <- fluidPage(
fluidRow(
column(width = 10, fileInput("file", "upload the file", accept = ".tsv", placeholder = "No file selected", multiple = FALSE))
)
)
#This is the function outside UI function and server function()
glycoPipe <- function(PARAMSfullFile=NULL){
params <- checkParams(filename)
list(params = params)
}
#This function is defined in a script called utilities.R which is found in the utilityFoler specified in
#the source statement
params <- checkParams(filename)
}
in utilities script the funcion is:
checkParams <- function(PARAMSfullFile){
params = PARAMSfullFile
return(params)
}
This is the server function:
server <- function(input, output, session){
source("UtilityFoler/utilities.R", chdir = TRUE)
observeEvent(input$value,{
if(input$value == 'Y'){
inFileName = input$file$name
result <- glycoPipe("glycoPipe_PARAMS_TEMPLATE.tsv")
returnedValue = result$params
output$box <- renderText({
paste("Your result is ", returnedValue)
}
)
}
})