R: Primitive Function - For Historical or Efficiency Reasons?

喜欢而已 提交于 2021-02-19 03:42:10

问题


How would I find list of primitive functions in R meant for historical or efficiency reasons?

Primitive functions are the ones that provide links between R code and the C code used to write R.


回答1:


This will get you the names of all R functions that wrap calls to .Primitive():

nms <- names(methods:::.BasicFunsList)        ## ?.BasicFunsList for more info

length(nms)
# [1] 192
c(head(nms, 8), tail(nms, 8))
#  [1] "$"          "$<-"        "["          "[<-"       
#  [5] "[["         "[[<-"       "%*%"        "xtfrm"     
#  [9] "switch"     "tracemem"   "unclass"    "untracemem"
# [13] "while"      "{"          "||"         "~"      



回答2:


This is the the manual by Cran, which has a lot of information regarding historical and efficiency. It has a brief introduction of R commands and which one is better to use in which scenario.



来源:https://stackoverflow.com/questions/12632246/r-primitive-function-for-historical-or-efficiency-reasons

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!