I am new to R language. I am trying to run the Tesseract OCR function if the uploaded file is pdf file, it seems like it always goes to the else part. I know there is an error in the if part but I have no clue to use what symbol.
Here are some part of the code
output$table <- renderTable({
if(is.null(input$file)) {return()}
read.table(file=input$file$datapath[input$file$name==input$Select], fill = TRUE, skipNul = TRUE)
# PDF file
if (input$file$datapath[input$file$name==input$Select] == "pdf"){
pdffile <- pdftools::pdf_convert(input$file$datapath[input$file$name==input$Select], dpi = 600)
text <- tesseract::ocr(pdffile)
}
# JPEG file
else{
eng <- tesseract("eng")
text <- tesseract::ocr(input$file$datapath[input$file$name==input$Select], engine = eng)
}
})