
235
235
12.4 部分集合
(0.266,0.292] (0.292,0.318] (0.318,0.344] (0.344,0.37] (0.37,0.396]
132 70 11 5 2
12.3.3
グループ化変数でオブジェクトを結合する
ソースにラベリングした列とデータフレームの中の似たようなオブジェクト(ベク
トルまたはデータフレーム)のセットを結合したいかもしれません。そんなときは、
lattice
パッケージの
make.group
関数を使うといいでしょう。
library(lattice)
make.groups(...)
データフレーム中の
3
つの異なるベクトルを結合してみましょう。
> hat.sizes <- seq(from=6.25, to=7.75, by=.25)
> pants.sizes <- c(30, 31, 32, 33, 34, 36, 38, 40)
> shoe.sizes <- seq(from=7, to=12)
> make.groups(hat.sizes, pants.sizes, shoe.sizes)
data which
hat.sizes1 6.25 hat.sizes
hat.sizes2 6.50 hat.sizes
hat.sizes3 6.75 hat.sizes
hat.sizes4 7.00 hat.sizes
hat.sizes5 7.25 hat.sizes
hat.sizes6 7.50 hat.sizes
hat.sizes7 7.75 ...