stan-dev / rstanarm

rstanarm R package for Bayesian applied regression modeling
https://mc-stan.org/rstanarm
GNU General Public License v3.0
388 stars 133 forks source link

I can't install rstanarm from Github #618

Open vegetableAndy opened 7 months ago

vegetableAndy commented 7 months ago

Summary:

I want to install rstanarm from GitHub to use 'stan_surv' function.

Description:

I am trying to perform Bayesian survival analysis on my data, so I install rstanarm package by the following command:

install.packages("rstanarm")

But when I use "stan_surv" command, R reminded me that the function doesn't exist. As a result, I looked up information online to solve this problem. Then I learned that to use 'stan_surv', rstanarm package should be installed by:

install.packages("rstanarm", repos = c("https://mc-stan.org/r-packages/", getOption("repos")))

I ran the command above in my Rstudio. However, I still can't use "stan_surv"function, and the same error occurred again. I was so confused that I kept on trying to solve the problem. Then I found that the same question have been asked before in GitHub, the man who answered the question said that you have to install rstanarm package from GitHub. So I installed the rstan package and C++ toolchain for rstanarm package from GitHub. I ran the cmmamds in RStudio and R from GitHub:

Sys.setenv(MAKEFLAGS = "-j2")
Sys.setenv("R_REMOTES_NO_ERRORS_FROM_WARNINGS" = "true")
remotes::install_github("stan-dev/rstanarm", INSTALL_opts = "--no-multiarch", force = TRUE)

But it occoured such errior:

Warning messages:
1: In utils::untar(tarfile, ...) :
  ‘tar.exe -xf "C:\Users\DELL\AppData\Local\Temp\Rtmp8AiDYz\file394092e82.tar.gz" -C "C:/Users/DELL/AppData/Local/Temp/Rtmp8AiDYz/remotes394026fb3832"’ returned error code 1
2: In i.p(...) :
  installation of package‘C:/Users/DELL/AppData/Local/Temp/Rtmp8AiDYz/file39405346e69/rstanarm_2.32.1.tar.gz’had non-zero exit status

Is there anyone encountered the same issue and solve such problem? Could you please help me? Appreaciate it!