This looks like a problem with the R installation. As explained here:
http://cran.r-project.org/bin/linux/ubuntu/README
you need to install R-base-dev to install from source. This package contains the necessary tools to build R packages from a tarball (.tar.gz file).
Note that installing from CRAN on a Linux system using install.packages()
also requires the R-base-dev. install.packages()
downloads the source tarball from CRAN and builds the package on your own system.