Question

We're having trouble trying to install rstan at our server running Rstudio (version 0.97). We're using Ubuntu 12.10 ( x86_64-pc-linux-gnu (64-bit)) and R 2.15.1.

I installed Rcpp_0.10.3 and inline_0.3.11. However, when I run

options(repos = c(getOption("repos"), rstan = "http://wiki.stan.googlecode.com/git/R"))
install.packages('rstan', type = 'source')

I get the following error:

g++: error: ***********HYPERATIVA**********: No such file or directory
g++: error: Analytics: No such file or directory
g++: error: Welcome: No such file or directory
g++: error: to: No such file or directory
g++: error: R!: No such file or directory
g++: error: ***********HYPERATIVA**********: No such file or directory
g++: error: Analytics: No such file or directory
g++: error: Goodbye!: No such file or directory
make: *** [rstan.so] Error 1
ERROR: compilation failed for package ‘rstan’
* removing ‘/home/likewise-open/HYPERATIVANET/mgaldino/R/library/rstan’

However, these folders do exist and everything works fine with other packages. Does any of you know what to do?

Était-ce utile?

La solution

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')
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top