To distribute R code, first of all, you need to install R on every single node across your cluster. You can find all kinds of information of how to install R on debian distribution etc. Here I will tell you how to properly install R on Redhat 6.
Redhat is using RPM(Redhat Package Manager) and for a Redhat 6.4 (Amazon Web Service), when you are trying to do sudo yum install R, the computer is not smart enough to figure out what you are trying to install.
Actually, they do have the R package for Redhat 6 but it is in the EPEL(Extra Package for Enterprise Linux). You can find all the packages available for Redhat 6 here(clearly, you can see R-core, R-dev.. in that list).
What you need to do is:
su -c 'rpm -Uvh http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm'
Then you can install R in one go:
su -c 'yum install -y R R-core R-core-devel R-devel'
Note, the -y flag answers yes to all the questions asking you ‘Is that OK with you [yes/no]’ 🙂