Example: Install tdr package with all dependent packate
R --vanilla <<EOF
install.packages('tdr', repos='http://cran.cnr.berkeley.edu/')
q()
EOF