R 中应用函数族的命名/名称 [英] Naming / Names of the apply function family in R

查看:21
本文介绍了R 中应用函数族的命名/名称的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前正在学习 R.特别是我需要记住 apply 函数系列中的函数(例如 lapplysapplymapply 等).我知道 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.

每个应用函数的前缀是否有自然含义(如lapply = 'list'-apply)?

Is there a natural meaning for the prefix of each apply function (like lapply = 'list'-apply)?

推荐答案

是的,您获得了以下 apply r-基本功能:

Yes, you got following apply r-basic functions:

  • apply 申请 ;)
  • lapply 用于列表或向量(文档)
  • vapply 用于特定回报 value (文档)

  • apply for apply ;)
  • lapply for lists or vectors (documentation)
  • vapply for specific return value (documentation)

sapply 简单 (文档)

mapply 用于多个列表或向量参数(文档)

tapply for table(检查旧问题 这里)

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.

还有 lapplysapplyvapply 位于同一个文档站点中,因为 sapplyvapplylapply

Also lapply, sapply and vapply are in the same documentation site, since the sapply and vapply are wrapper for lapply

这篇关于R 中应用函数族的命名/名称的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆