R中应用功能族的命名/名称 [英] Naming / Names of the apply function family in R
问题描述
我目前正在研究R.尤其是我需要记住 apply
-function系列中的函数(例如 lapply
, sapply
, mapply
等).我知道 apply
-function系列中的每个函数的作用(尤其是
I'm currently studying R. In particular I need to remember the functions in the apply
-function family (e.g. lapply
, sapply
, mapply
, etc.). I know what each function in the apply
-function family does (especially this answer helps a lot), but mixes the names up from time to time.
每个apply函数的前缀(例如 lapply ='list'-apply
)的前缀自然存在吗?
Is there a natural meaning for the prefix of each apply function (like lapply = 'list'-apply
)?
推荐答案
是的,您遵循了 apply
r-basic函数:
Yes, you got following apply
r-basic functions:
-
apply
for apply;) 列表的 -
lapply
或矢量(文档)
apply
for apply ;)lapply
for lists or vectors (documentation)vapply
for specific return value (documentation)
sapply
(简单) mapply
(多个)列表或向量参数
mapply
for multiple list or vector arguments (documentation)
tapply
for table (check old question here)
rapply
(递归)(我认为您可以不同地解释一些前缀,例如注释中提到的 m
是多变量的(注释已删除).我尝试使用文档的措辞,因此更容易理解.
I think you can interprete some prefix differently, like m
was mentioned in the commentary as multivariate (commentary got removed). I tried to use the wording of the documentation, so it's more likely to be understood.
另外, lapply
, sapply
和 vapply
在同一文档站点中,因为 sapply
和 vapply
是 lapply
Also lapply
, sapply
and vapply
are in the same documentation site, since the sapply
and vapply
are wrapper for lapply
这篇关于R中应用功能族的命名/名称的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!