问题
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