Helper function to download training data from the official tessdata repository. Only use this function on Windows and OS-X. On Linux, training data can be installed directly with yum or apt-get.

tesseract_download(lang, datapath = NULL, progress = interactive())



three letter code for language, see tessdata repository.


destination directory where to download store the file


print progress while downloading


Tesseract uses training data to perform OCR. Most systems default to English training data. To improve OCR performance for other languages you can to install the training data from your distribution. For example to install the spanish training data:

On Windows and MacOS you can install languages using the tesseract_download function which downloads training data directly from github and stores it in a the path on disk given by the TESSDATA_PREFIX variable.


tesseract wiki: training data

See also

Other tesseract: ocr(), tesseract()


if (FALSE) { if("fra", tesseract_info()$available))) tesseract_download("fra") french <- tesseract("fra") text <- ocr("", engine = french) cat(text) }