Subsetting Data
- Selecting specific variable(s)
## [1] 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2
## [1] TRUE
## [1] 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2
## method score
## 1 1 35
## 2 1 23
## 3 1 14
## 4 1 17
## 5 1 23
## 6 1 35
## 7 1 27
## 8 1 33
## 9 1 32
## 10 1 31
## 11 2 34
## 12 2 27
## 13 2 51
## 14 2 36
## 15 2 39
## 16 2 45
## 17 2 31
## 18 2 40
## 19 2 25
## 20 2 32
- Selecting specific observation(s)
## method score
## 1 1 35
## 2 1 23
## 3 1 14
## 4 1 17
## 5 1 23
## 6 1 35
## 7 1 27
## 8 1 33
## 9 1 32
## 10 1 31
## 11 2 34
## 12 2 27
## 13 2 51
## 14 2 36
## 15 2 39
## 16 2 45
## 17 2 31
## 18 2 40
## 19 2 25
## 20 2 32
## method score
## 2 1 23
## 4 1 17
## [1] 25
- Selecting specific subgroup(s)/subset(s)
## method score
## 1 1 35
## 2 1 23
## 3 1 14
## 4 1 17
## 5 1 23
## 6 1 35
## 7 1 27
## 8 1 33
## 9 1 32
## 10 1 31
## method score
## 1 1 35
## 2 1 23
## 3 1 14
## 4 1 17
## 5 1 23
## 6 1 35
## 7 1 27
## 8 1 33
## 9 1 32
## 10 1 31
## method score
## 1 1 35
## 6 1 35
## 8 1 33
## 9 1 32
## 10 1 31
## 11 2 34
## 13 2 51
## 14 2 36
## 15 2 39
## 16 2 45
## 17 2 31
## 18 2 40
## 20 2 32