Rで作図

最近Rの勉強をしています。
TSは散布図は一度に一個なので、フィールドが複数ある場合不便です。
その点Rはデーターフレームであればplotで一気に描けるのでいいなあって思います。
そんなRできれいな図を描くツールとしてggplot2があります。
さらにプロットマトリックスを作るツールとしてGGallyが素敵です。
インストールはこんな感じで

> install.packages("GGally",dependencies=T)

でggpairsでマトリックスプロットを作ります。
data引数にデーターフレームを
columnsに使用するカラムを
colors にファクターを入れると

> library("GGally")
> data(iris)
> ggpairs(data=iris, columns=1:4, color="Species")

とすると、以下のようなグラフができます。
Rplot
いいでね

Published by iwatobipen

I'm medicinal chemist in mid size of pharmaceutical company. I love chemoinfo, cording, organic synthesis, my family.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: