Windows10でRStudioをインストールしてggplot2を使用できるようにする
RStudioというソフトで、R Markdownを用いて、統計を行いたい!(t検定とか繰り返したり、グラフを繰り返し描きたい!)
開発環境
Windows10 Pro
今回構築した環境
EZR (Ver. 1.38 2019/2/1)
R version 3.5.3 (2019-03-11)
R Studio Version 1.1.463
install.packages("tidyverse")
EZRのインストール
まずは、以下のページからEZRをインストールします。
(自分でRで計算していると、ミスしたときに気付かないので、その答え合わせのためにも、EZRも使用したいため。)
このとき、Rも自動的にインストールされます。
http://www.jichi.ac.jp/saitama-sct/SaitamaHP.files/download.html

私の場合は、EZR 64bitを使用しています。

RStudioのインストール
以下のサイトからWindows版をダウンロードしてインストールします。
https://www.rstudio.com/products/rstudio/download/

日本語の設定
Rmdファイルの日本語が文字化けしたら、
File -> Reopen with Encodingで UTF-8に変更


RStudioにtidyverseをインストール
ggplot2は、Rでグラフを描くときに便利なパッケージです。
tidyverseをインストールすることにより、tidyrやggplot2なども自動的にインストールされます。
console画面(RStudioですと、左下の画面内に“console”タブがあると思います。)で、以下を入力して、tidyverseパッケージをインストールします。(ggplot2なども一緒にインストールされます。)
install.packages("tidyverse")

5分くらいして、以下のように、tidyverseその他がインストールされます。これで、ggplot2というpackageが使えるようになります。

ggplot2の使い方については、以下の本がお勧めです。
ggplot2の使い方については、ggplot2の作者が著者の以下の本が非常にお勧めです。
ggplot2を用いたグラフの描き方については、以下の本が非常にお勧めです。
英語ですが、以下のサイトに非常によくまとまっています。
http://www.cookbook-r.com/Graphs/
参考リンク
https://qiita.com/hujuu/items/ddd66ae8e6f3f989f2c0


http://wakate2014ima.wikidot.com/

https://qiita.com/d-cassette/items/59bb6e4b9bbf8e53d2a9
@d-cassette
2017年04月26日に投稿
Rで現在のディレクトリ確認と変更

ディスカッション
コメント一覧
まだ、コメントがありません