> merge(t2, paar, by.x="number", by.y="nr") number taht paaritu sona 1 1 a 1 yks 2 2 b 2 kaks > t2 taht number paaritu 1 a 1 1 2 b 2 2 3 c 3 1 4 d 4 2 5 e 5 1 6 f 6 2 > paar nr sona 1 1 yks 2 2 kaks > aggregate(mtcars[c("cyl", "wt")], by=list(mtcars$am), FUN=mean) Group.1 cyl wt 1 0 6.947368 3.768895 2 1 5.076923 2.411000 > paste("v", 1:3) [1] "v 1" "v 2" "v 3" > paste("v", 1:3, sep="") [1] "v1" "v2" "v3" > mtcars[mtcars$am==1, c("cyl", "mpg")] cyl mpg Mazda RX4 6 21.0 Mazda RX4 Wag 6 21.0 Datsun 710 4 22.8 Fiat 128 4 32.4 Honda Civic 4 30.4 Toyota Corolla 4 33.9 Fiat X1-9 4 27.3 Porsche 914-2 4 26.0 Lotus Europa 4 30.4 Ford Pantera L 8 15.8 Ferrari Dino 6 19.7 Maserati Bora 8 15.0 Volvo 142E 4 21.4 > subset(mtcars, am==1, select=c(cyl, mpg)) cyl mpg Mazda RX4 6 21.0 Mazda RX4 Wag 6 21.0 Datsun 710 4 22.8 Fiat 128 4 32.4 Honda Civic 4 30.4 Toyota Corolla 4 33.9 Fiat X1-9 4 27.3 Porsche 914-2 4 26.0 Lotus Europa 4 30.4 Ford Pantera L 8 15.8 Ferrari Dino 6 19.7 Maserati Bora 8 15.0 Volvo 142E 4 21.4