www.crosshyou.info

政府統計の総合窓口のデータや、OECDやUCIやのデータを使って、Rの練習をしています。ときどき、読書記録も載せています。

都道府県別の一般病院病床利用率のデータ分析2 - gridExtra::grid.arrange()関数でグラフを並べて表示する。

f:id:cross_hyou:20210821151055j:plain

 Photo by L J on Unsplash  

www.crosshyou.info

 の続きです。

今回はgridExtraパッケージのgrid.arrange()関数でグラフを並べて表示できることを知ったので、忘れないように実践します。

riyou: 一般病院病床利用率(%)をグラフにします。

まずは、ヒストグラムを描いてみます。

f:id:cross_hyou:20210821150043p:plain

f:id:cross_hyou:20210821150054p:plain

あとで、grid.arannge()関数で使うので、histogramという名前でグラフオブジェクトを保存しています。

ヒストグラムの形状を見ると、一般病院病床利用率は正規分布チックな分布ですね。

次は密度分布のグラフです。

f:id:cross_hyou:20210821150315p:plain

f:id:cross_hyou:20210821150325p:plain

3番目は箱ひげ図にします。

f:id:cross_hyou:20210821150428p:plain

f:id:cross_hyou:20210821150439p:plain

外れ値は無いのですね。

 

最後はQQプロットです。

f:id:cross_hyou:20210821150616p:plain

こうして作成した4つのグラフを並べて表示するのに、gridExtra::grid.arrange()関数を使います。

まず、gridExtraパッケージの読み込みをして、grid.arrange()関数を使いました。

f:id:cross_hyou:20210821150843p:plain

f:id:cross_hyou:20210821150856p:plain

はい、できました。

今回は以上です。

次回は

 

www.crosshyou.info

 です。

第1回目は

 

www.crosshyou.info

 です。