Upon further review, this problem seems to be caused in versions of RStan <= 1.3.0 when a site-wide or user's Rprofile file contains cat
calls such as "Welcome to R!". A possible workaround is to temporarily set the environmental variables R_PROFILE and R_PROFILE_USER to point to an empty file.
For plain R (not RStudio), execute in a bash shell:
touch /tmp/Rprofile
export R_PROFILE=/tmp/Rprofile
export R_PROFILE_USER=/tmp/Rprofile
R -e "install.packages('rstan', type='source',repos='http://wiki.stan.googlecode.com/git/R')"
export R_PROFILE=
export R_PROFILE_USER=
If RStudio is already running, execute the equivalent in RStudio:
system('touch /tmp/Rprofile')
Sys.setenv(R_PROFILE="/tmp/Rprofile")
Sys.setenv(R_PROFILE_USER="/tmp/Rprofile")
install.packages('rstan', type='source', repos='http://wiki.stan.googlecode.com/git/R')
Sys.unsetenv('R_PROFILE')
Sys.unsetenv('R_PROFILE_USER')