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