select_at()的作用是什么? [英] What is select_at() for?
问题描述
我了解如何使用 dplyr :: select_if()
和 dplyr :: mutate_at()
。但是我不明白 dplyr :: select_at()
所提供的内容,而基本的 select()
所没有提供。
I understand how to use dplyr::select_if()
and dplyr::mutate_at()
. But I don't understand what dplyr::select_at()
provides that a basic select()
doesn't provide.
据我了解, verb_at()
函数可让您利用选择帮助器功能(例如 matches()
和 starts_with()
)。但是 select()
已经使用了选择助手-那么为什么要使用 select_at()
而不是仅仅使用 select()
?
As far as I understand, the verb_at()
functions allow you to utilize the select helper functions (like matches()
and starts_with()
). But select()
already uses the select helpers--so why would you use select_at()
instead of just select()
?
推荐答案
的主要优点select_at()
(而不是普通的 select()
)在于它提供了 .funs =
参数,以便您可以使用函数,例如。 toupper()
在选择文件时重命名文件。
The primary benefit of select_at()
(as opposed to the vanilla select()
) is that it provides an .funs=
parameter so that you can use a function, eg. toupper()
to rename files as you select them.
对于诸如 rename_at()
之类的东西,这很有意义。从tidyverse风格的一切都一样的角度来看,使用 select_at()
提供类似的功能是有意义的。
This makes a ton of sense for something like rename_at()
. Providing similar functionality with select_at()
makes sense from a tidyverse-style "everything works the same" perspective.
这篇关于select_at()的作用是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!