# NOT RUN {
# single variable
extract(mtcars, cyl, name = gear)
extract(mtcars, "cyl", name = gear)
extract(mtcars, -1, name = gear)
extract(mtcars, cyl, name = 0)
extract(mtcars, cyl, name = "row.names")
# selecting multiple variables
head(extract(iris, starts_with("Sepal")))
head(extract(iris, ends_with("Width")))
head(extract(iris, 2:4))
# select first of multiple variables
extract(iris, starts_with("Sepal"), extract = "first")
# select first of multiple variables, return as data frame
head(extract(iris, starts_with("Sepal"), extract = "first", as_data_frame = TRUE))
# }
Run the code above in your browser using DataLab