Setting up the OCR add-on package

The OCR package needs another R package (to read in PGM images) called pixmap. This is available here (look for a file of the form pixmap_x.y-z.tar.gz). You could either download it and install it manually:

$ wget http://cran.r-project.org/src/contrib/pixmap_0.4-0.tar.gz
$ R INSTALL pixmap_0.4-0.tar.gz

or install it from inside R using the install.packages() function

$ R

R : Copyright 2004, The R Foundation for Statistical Computing
Version 1.8.1 Patched (2004-02-10), ISBN 3-900051-00-3

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for a HTML browser interface to help.
Type 'q()' to quit R.

> install.packages("pixmap")
trying URL `http://cran.r-project.org/src/contrib/PACKAGES'
Content type `text/plain; charset=iso-8859-1' length 165272 bytes
opened URL
.......... .......... .......... .......... ..........
.......... .......... .......... .......... ..........
.......... .......... .......... .......... ..........
.......... .
downloaded 161Kb
.
.
.

In both cases, you will have to start R as root (unless you compiled R as yourself). It's possible to install these packages even without root previleges, ask me if you need to know how.

Installing the OCR package

After this, you are ready to install the OCR package. For this, download bocra_0.1-1.tar.gz, and install it using

$ R INSTALL bocra_0.1-1.tar.gz

as indicated earlier for pixmap. Once you have done this successfully, you are all set to go.

The source code for the package can be viewed and modified after untarring this file. The source can also be browsed online here. The R/ subdirectory contains R code, and src/ contains the C implementations for certain tasks.


If you have any questions or comments, contact me at deepayan at stat.wisc.edu