View source: R/select_otherwise.R
select_otherwise | R Documentation |
flexible select operator that powers the tidy consultant universe. Used to set sensible defaults and flexibly return the chosen columns. A developer focused function, but may be useful in interactive programming due to the ability to return different types.
select_otherwise(
.data,
...,
otherwise = NULL,
col = NULL,
return_type = c("names", "index", "df")
)
.data |
dataframe |
... |
tidyselect. columns to choose |
otherwise |
tidyselect. default columns to choose if ... is not specified |
col |
tidyselect. column to choose regardless of ... or otherwise specifications |
return_type |
choose to return column index, names, or df. defaults to index |
integer vector by default. possibly data frame or character vector
iris %>%
select_otherwise(where(is.double), return_type = "index")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.