Selecting multiple elements with [
df[rows, cols]
selecting just one column:
- with a
tibble
you still get a data frame (tibble) - but with a
data.frame
simplification to vector is applied:- except
df[rows, cols, drop = FALSE]
: maintains thedata.frame
class
- except
## x y z
## 1 1 k FALSE
## 2 2 l TRUE
## [1] FALSE TRUE
## z
## 1 FALSE
## 2 TRUE