My workspace (aka global environment) contains the data frame mtcars that consists of three variables: mpg, cyl and disp (in that order). Which command return the variable cyl as atomic vector?
Asked
Active
Viewed 40 times
0
-
… `mtcars$cyl`. – Konrad Rudolph Mar 27 '20 at 12:23
-
mtcars$cyl #(5 more to go) – Edward Mar 27 '20 at 12:24
1 Answers
0
Or with dyplr
:
library(dyplr)
mtcars %>% pull(cyl)
This can be handy if you want to add further operations to the extracted vector.

Cian
- 58
- 7