R Commander でのメニュー操作のマークダウン化

データ「iris」読み込み

> data(iris)

インデックス・プロット作図

> indexplot(iris[,'Petal.Length', drop=FALSE], type='p', id.method='y', id.n=2)

[1] 118 119

ドットプロット作図

> with(iris, Dotplot(Petal.Length, by=Species, bin=FALSE))

二次元散布図作図

> scatterplot(Petal.Width~Petal.Length | Species, regLine=FALSE, smooth=FALSE, boxplots=FALSE, by.groups=TRUE, 
+   data=iris)

条件付き二次元散布図作図

> library(lattice, pos=17)

1) 条件なし/グループなし

> xyplot(Petal.Width ~ Petal.Length, type="p", pch=16, auto.key=list(border=TRUE), par.settings=simpleTheme(pch=16), 
+   scales=list(x=list(relation='same'), y=list(relation='same')), data=iris)

2) 条件=Species/グループなし

> xyplot(Petal.Width ~ Petal.Length | Species, type="p", pch=16, auto.key=list(border=TRUE), 
+   par.settings=simpleTheme(pch=16), scales=list(x=list(relation='same'), y=list(relation='same')), data=iris)

3) 条件なし/グループ=Species

> xyplot(Petal.Width ~ Petal.Length, groups=Species, type="p", pch=16, auto.key=list(border=TRUE), 
+   par.settings=simpleTheme(pch=16), scales=list(x=list(relation='same'), y=list(relation='same')), data=iris)

4) 条件=Species/グループ=Species

> xyplot(Petal.Width ~ Petal.Length | Species, groups=Species, type="p", pch=16, auto.key=list(border=TRUE), 
+   par.settings=simpleTheme(pch=16), scales=list(x=list(relation='same'), y=list(relation='same')), data=iris)

散布図行列

> scatterplotMatrix(~Petal.Length+Petal.Width+Sepal.Length+Sepal.Width | Species, 
+                        regLine=FALSE, smooth=FALSE, diagonal=list(method="density"), by.groups=TRUE, data=iris)

三次元散布図

> library(rgl, pos=18)
> library(nlme, pos=19)
> library(mgcv, pos=19)
> scatter3d(Sepal.Length~Petal.Length+Petal.Width|Species, data=iris, surface=FALSE, residuals=TRUE, parallel=FALSE, 
+   bg="white", axis.scales=TRUE, grid=TRUE, ellipsoid=FALSE)

You must enable Javascript to view this page properly.