執行次數是否與以下不同?`<-`實際上比`=`慢嗎?
library(microbenchmark)
microbenchmark(x = NULL, x <- NULL, times = 100e3)
Unit: nanoseconds
expr min lq mean median uq max neval
x 0 0 0.60819 0 0 8426 1e+05
x <- NULL 0 0 1.75101 0 1 8727 1e+05
我得到一個警告,說明大約75%的評估具有非正定的執行時間。但是,每次運行此操作時,我都會得到一致的結果:平均而言,x = NULL
比x <- NULL
快。
這兩個[call](https://github.com/wch/r-source/blob/trunk/src/main/names.c#L100)[相同的C函數](https://github.com /wch/r-source/blob/trunk/src/main/eval.c#L2685)。沒有性能差異。 – Roland