r - 何时在 R 中使用配对列表?

标签 r performance

我知道大多数情况下,点对列表不在核心语言之外使用,但我认为出于某种原因,它们在内部而不是通用向量中使用。

为什么在 R 内部使用 pairlists,在你自己的函数中使用 pairlists 有什么性能优势?

最佳答案

回答你的第二个问题,我不这么认为。 Section 2.1.11 R 文档中指出:

Pairlists are handled in the R language in exactly the same way as generic vectors (“lists”). In particular, elements are accessed using the same [[]] syntax. The use of pairlists is deprecated since generic vectors are usually more efficient to use. When an internal pairlist is accessed from R it is generally (including when subsetted) converted to a generic vector.

关于r - 何时在 R 中使用配对列表?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17637128/

相关文章:

r - 在 R 中如何用英语获取错误消息

r - R中的欧几里德距离计算没有意义

performance - Bigquery.go 导出作业比 WebGUI 慢得多

c# - 鉴于我们只想要第一条记录,在 linq 查询中选择之前排序是否更好?

iphone - 如何使用 asihttprequest 跟踪单个下载速度

r - 如何将每列除以 R 中的数字?

r - 如何从 R 中将 Excel 工作表范围导出到图片

r - 如何在R中过滤一系列数字?

.net - 定时器效率

c++ - 如何高效转置非方阵?