Subset a data frame by column name or column position
select.RdSubsets a data frame to only columns specified. Will not 'drop' to vector
type. This is only a convenience function that replicates the standard
data[, x, drop = FALSE].
Examples
#----------------------------------------------------------------------------
# select() examples
#----------------------------------------------------------------------------
library(bkdat)
df <- data.frame(a = c(1, 2, 3), b = c(4, 5, 6))
select(df, "a")
#> a
#> 1 1
#> 2 2
#> 3 3
select(df, 2)
#> b
#> 1 4
#> 2 5
#> 3 6
select(df, c(TRUE, FALSE))
#> a
#> 1 1
#> 2 2
#> 3 3