The function in the server below has always worked fine, but lately it throws the error:
"Error in =: invalid (NULL) left side of assignment". it seems as no value is being returned from the glysoPipe() function and no value is being assigned to the receiving variable. I looked for information in Google and I found the following link: Error in { invalid (NULL) left side of the assignment | The Data Science Learner. There is not explanation to the problem. Could anyone help with this?
Blockquote
fluidPage(
verbatimTextOutput("theError")
)
glycoPipe <- function(infileName)
{
errorMessage = TRUE
list(errorMessage = errorMessage)
}
server <- function(input, output){
inFile <- reactive({input$file})
inFileName <- reactive({input$file$name})
output$contents <- renderTable({
inFile <- input$file
inFileName <- input$file$name
if(input$btn){
hide("btn")
}
if(is.null("inFile")){
return()
}
req(inFile)
validate( need(tools::file_ext(inFileName) %in% c(
'tsv'
), "Wrong File Format. The selected file is not a valid tab-separated PARAMS file. Try again. If you do not have a parameters.tsv file in your directory stop clycoPipe create a file and re-start glycoPipe. Otherwise, you can download a PARAMS file by answering (N) to the question (Do you have a parameters file ready to use) in the letf hand-side panel? Save this file to the directory of your choice, and stop and restart glycoPipe"))
read.delim(inFile$datapath, quote = "", sep = '\t')
#' When files get uploaded, their new filenames are gibberish.
#' This function renames all uploaded files to their original names
#' @param inFile The dataframe returned from a shiny::fileInput
if (is.null(inFile)) {
return()
}
oldNames = inFile$datapath
newNames = file.path(dirname(inFile$datapath),inFile$name)
file.rename(from = oldNames, to = newNames)
inFileName <- inFile$datapath <- newNames
})
output$theError <- renderPrint({
errormessage = glycoPipe(inFileName())
errormessage$errorMessage
})
}