fselect {timeplyr} | R Documentation |
Fast dplyr::select()
/dplyr::rename()
Description
fselect()
operates the exact same way as dplyr::select()
and
can be used naturally with tidy-select
helpers.
It uses collapse to perform the actual selecting of variables and is
considerably faster than dplyr for selecting exact columns,
and even more so when supplying the .cols
argument.
Usage
fselect(data, ..., .cols = NULL)
frename(data, ..., .cols = NULL)
Arguments
data |
A data frame. |
... |
Variables to select using |
.cols |
(Optional) faster alternative to |
Value
A data.frame
of selected columns.
Examples
library(timeplyr)
library(dplyr)
df <- slice_head(iris, n = 5)
fselect(df, Species, SL = Sepal.Length)
fselect(df, .cols = c("Species", "Sepal.Length"))
fselect(df, all_of(c("Species", "Sepal.Length")))
fselect(df, 5, 1)
fselect(df, .cols = c(5, 1))
df %>%
fselect(where(is.numeric))
[Package timeplyr version 0.8.1 Index]