This might be even better:

    sudo apt-get install $(Rscript -e "paste(sprintf('r-cran-%s', tolower(commandArgs(TRUE))), collapse=' ')" $*)