I have tried installing R on CentOS 5.5 by the following way and it test good.
rpm -Uvh http://download.fedora.redhat.com/pub/epel/5/i386/epel-release-5-4.noarch.rpm
yum install R
You can run the R with scripts from cmd line by doing one of the following:
R < mean.R
R CMD BATCH mean.R
Rscript mean.R