性懲りも無くcmdstanrを入れてみた

 なんだかRstanは更新が来ないと言われているようで・・・それとは全く関係なく必要に応じてcmdstanrを入れてみた。R4.4.2でインストールしようとすると相変わらずエラー。ということでRstudioを使ってgit hubからインストールを試みた。
 

>library(devtools)
>devtools::install_github("stan-dev/cmdstanr")
   (中略)
* installing *source* package ‘cmdstanr’ ...
** using staged installation
** R
** inst
** byte-compile and prepare package for lazy loading
** help
*** installing help indices
*** copying figures
** building package indices
** installing vignettes
** testing if installed package can be loaded from temporary location
** testing if installed package can be loaded from final location
** testing if installed package keeps a record of temporary installation path
* DONE (cmdstanr)

あ・・・何事もなく終わってしまった・・・。

 で、本当はrethinkingというパッケージを使いたかっただけなのだけど、Rstanは更新されてないのでうんぬんだったのでちょっと使ってみることにした。
 ちなみにrethinkingもちょっとインストールで色々あって、

> install.packages(c("coda","mvtnorm","devtools"))
    (略)
> library(devtools)
> devtools::install_github("rmcelreath/rethinking")
     (略)
>ERROR: dependency ‘cmdstanr’ is not available for package ‘rethinking’

で、前述のようにcmdstanrを入れたんですね。そしてまた改めてインストールしようとしたらusethisを入れろと。じゃあ
  

> install.packages("usethis")
Error in install.packages : Updating loaded packages

Restarting R session...

> install.packages("usethis")
    (略)
できた

なんかアップデートしろと出たのでOK押したらインストールできるようになった。よくわからない。
 というわけで最終的にrehtinkingパッケージがインストールできた。

この記事が気に入ったらサポートをしてみませんか?