Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide doc topic for <tidy-select> #328

Open
hadley opened this issue Oct 19, 2022 · 1 comment
Open

Provide doc topic for <tidy-select> #328

hadley opened this issue Oct 19, 2022 · 1 comment

Comments

@hadley
Copy link
Member

hadley commented Oct 19, 2022

e.g.

#' Argument type: tidy-select
#'
#' @description
#' This page describes the `<tidy-select>` argument modifier which
#' indicates that the argument uses **tidy selection**, a sub-type of
#' tidy evaluation. If you've never heard of tidy evaluation before,
#' start by reading
#' <https://r4ds.hadley.nz/functions.html#data-frame-functions>.
#'
#' # Overview of selection features
#'
#' ```{r, child = "man/rmd/overview.Rmd"}
#' ```
#'
#' # Indirection
#'
#' There are two main cases:
#'
#' *   If you have a character vector of column names, use `all_of()`
#'     or `any_of()`, depending on whether or not you want unknown variable
#'     names to cause an error, e.g `unnest(df, all_of(vars))`,
#'     `unnest(df, !any_of(vars))`.
#'
#' *   If you want the user to supply a tidyselect specification in a
#'     function argument, you need to tunnel the selection through the function
#'     argument. This is done by embracing the function argument `{{ }}`,
#'     e.g `unnest(df, {{ vars }})`.
#'
#' Learn more in `vignette("programming.Rmd")`.
#'
#' @keywords internal
#' @name tidyr_tidy_select
NULL
@DavisVaughan
Copy link
Member

DavisVaughan commented Oct 28, 2022

We could definitely use this in yardstick too for truth, estimate, and ... arguments

And workflows with add_variables()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants