Advanced-R-Solutions
Advanced-R-Solutions copied to clipboard
Exercise 19.3 Q2 Different Conclusion
Try to replicate the performance comparison between apply(x, 1, sum) and rowSums(x). It seems that the result I got indicates the running time gain is independent of the size of x. Is it due to apply function has a new version or is it related to the specific computer system I'm using.
Below is my system info and attached is the result comparison graph. R version 4.2.3 (2023-03-15) Platform: aarch64-apple-darwin20 (64-bit) Running under: macOS Ventura 13.3.1