select {tidytable} | R Documentation |
Select or drop columns
Description
Select or drop columns from a data.table
Usage
select(.df, ...)
Arguments
.df |
A data.frame or data.table |
... |
Columns to select or drop.
Use named arguments, e.g. new_name = old_name, to rename selected variables.
|
Examples
df <- data.table(
x1 = 1:3,
x2 = 1:3,
y = c("a", "b", "c"),
z = c("a", "b", "c")
)
df %>%
select(x1, y)
df %>%
select(x1:y)
df %>%
select(-y, -z)
df %>%
select(starts_with("x"), z)
df %>%
select(where(is.character), x1)
df %>%
select(new = x1, y)
[Package tidytable version 0.11.1 Index]