Platform: x86_64-apple-darwin17.7.0 (64-bit)
R は、自由なソフトウェアであり、「完全に無保証」です。
一定の条件に従えば、自由にこれを再配布することができます。
配布条件の詳細に関しては、'license()' あるいは 'licence()' と入力してください。
Natural language support but running in an English locale
R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.
'demo()' と入力すればデモをみることができます。
'help()' とすればオンラインヘルプが出ます。
'help.start()' で HTML ブラウザによるヘルプがみられます。
'q()' と入力すれば R を終了します。
起動準備中です - 警告メッセージ:
1: Setting LC_COLLATE failed, using "C"
2: Setting LC_TIME failed, using "C"
3: Setting LC_MESSAGES failed, using "C"
4: Setting LC_MONETARY failed, using "C"
>
さらに,RStanをインストールするには,Rが立ち上がっている状態で,以下のコマンドを入力します.
> install.packages("rstan")
すると,以下のようにインストールが始まります.
下記ののように,ミラーサイトの選択を要求されるので,Japan(42)を選択します.
パッケージを ‘/usr/local/lib/R/3.6/site-library’ 中にインストールします
(‘lib’ が指定されていないため)
--- このセッションで使うために、CRAN のミラーサイトを選んでください ---
Secure CRAN mirrors
1: 0-Cloud [https] 2: Algeria [https]
3: Australia (Canberra) [https] 4: Australia (Melbourne 1) [https]
5: Australia (Melbourne 2) [https] 6: Australia (Perth) [https]
7: Austria [https] 8: Belgium (Ghent) [https]
9: Brazil (PR) [https] 10: Brazil (RJ) [https]
11: Brazil (SP 1) [https] 12: Brazil (SP 2) [https]
13: Bulgaria [https] 14: Chile 1 [https]
15: Chile 2 [https] 16: China (Hong Kong) [https]
17: China (Guangzhou) [https] 18: China (Lanzhou) [https]
19: China (Shanghai 1) [https] 20: China (Shanghai 2) [https]
21: Colombia (Cali) [https] 22: Czech Republic [https]
23: Denmark [https] 24: Ecuador (Cuenca) [https]
25: Ecuador (Quito) [https] 26: Estonia [https]
27: France (Lyon 1) [https] 28: France (Lyon 2) [https]
29: France (Marseille) [https] 30: France (Montpellier) [https]
31: France (Paris 2) [https] 32: Germany (Erlangen) [https]
33: Germany (Göttingen) [https] 34: Germany (Münster) [https]
35: Greece [https] 36: Hungary [https]
37: Iceland [https] 38: Indonesia (Jakarta) [https]
39: Ireland [https] 40: Italy (Padua) [https]
41: Japan (Tokyo) [https] 42: Japan (Yonezawa) [https]
43: Korea (Busan) [https] 44: Korea (Gyeongsan-si) [https]
45: Korea (Seoul 1) [https] 46: Korea (Ulsan) [https]
47: Malaysia [https] 48: Mexico (Mexico City) [https]
49: Norway [https] 50: Philippines [https]
51: Serbia [https] 52: Spain (A Coruña) [https]
53: Spain (Madrid) [https] 54: Sweden [https]
55: Switzerland [https] 56: Turkey (Denizli) [https]
57: Turkey (Mersin) [https] 58: UK (Bristol) [https]
59: UK (London 1) [https] 60: USA (CA 1) [https]
61: USA (IA) [https] 62: USA (KS) [https]
63: USA (MI 1) [https] 64: USA (OR) [https]
65: USA (TN) [https] 66: USA (TX 1) [https]
67: Uruguay [https] 68: (other mirrors)
Selection: 42
すると,インストールが始まります(ズラズラと画面が流れて,完了までに結構時間がかかります).
Rへの読み込みは,以下のようにコマンドを入力します.
以下の設定を行うことが推奨されているようです.
> rstan_options(auto_write=TRUE)
> options(mc.cores=parallel::detectCores())
最初のコマンドは,コンパイルした結果を保存するもので,次のコマンドは複数のコアを使用するものです.
`R` を終了させるには,以下のコマンドを入力します.
> quit()
___
* `tap`を実行すると,以下のような画面が流れます.
Updating Homebrew...
==> Auto-updated Homebrew!
Updated 2 taps (homebrew/core and homebrew/cask).
==> New Formulae
...
==> Tapping brewsci/science
Cloning into '/usr/local/Homebrew/Library/Taps/brewsci/homebrew-science'...
remote: Enumerating objects: 435, done.
remote: Counting objects: 100% (435/435), done.
remote: Compressing objects: 100% (431/431), done.
remote: Total 435 (delta 2), reused 181 (delta 2), pack-reused 0
Receiving objects: 100% (435/435), 398.22 KiB | 152.00 KiB/s, done.
Resolving deltas: 100% (2/2), done.
Tapped 416 formulae (455 files, 1.2MB).
`...` は実際に表示されず,略していることを表します.
** `R`のインストールが始まると,以下のような画面が流れます.
==> Installing dependencies for r: isl, mpfr, gcc, gettext, libpng, openblas, pcre and readline
...
==> readline
readline is keg-only, which means it was not symlinked into /usr/local,
because macOS provides the BSD libedit library, which shadows libreadline.
In order to prevent conflicts when programs look for libreadline we are
defaulting this GNU Readline installation to keg-only.
For compilers to find readline you may need to set:
export LDFLAGS="-L/usr/local/opt/readline/lib"
export CPPFLAGS="-I/usr/local/opt/readline/include"
For pkg-config to find readline you may need to set:
export PKG_CONFIG_PATH="/usr/local/opt/readline/lib/pkgconfig"