Glue 列规范的 "fn" 和 "col" 参数在哪里命名 dplyr 中的列(使用 `across` 和 `where` 来自哪里?

Where do the "fn" and "col" arguments to the Glue column specifications to name columns in dplyr (using `across` and `where` come from?

我正在浏览 dplyr 中按列选项的小插图 (https://cran.r-project.org/web/packages/dplyr/vignettes/colwise.html),我遇到了这个:(从小插图逐字复制)


控制如何使用采用粘合规范的 .names 参数创建名称:

starwars %>% summarise(across(where(is.numeric), min_max, .names = "{fn}.{col}"))
#> # A tibble: 1 x 6
#>   min.height max.height min.mass max.mass min.birth_year max.birth_year
#>        <int>      <int>    <dbl>    <dbl>          <dbl>          <dbl>
#> 1         66        264       15     1358              8            896

我的问题是:变量fncol是从哪里来的?我在主要 Glue 小插图中没有看到任何相关内容。 across 对应的参数是 .fns.cols 所以我看不到确切的对应关系。对于我来说,这个问题似乎太模糊了,无法通过文档进行疯狂的追逐,所以我希望有人能指出我正确的方向。

来自 across 的联机帮助:

.姓名
描述如何命名输出列的粘合规范。这可以用{col}代表选择的列名,用{fn}代表应用的函数名。对于单函数情况,默认值 (NULL) 等效于 {col},对于 .fns.

使用列表的情况,默认值 (NULL) 等效于 {col}_{fn}