library(plyr)
library(ggplot2)
id.test <- function(n) {
a <- seq_len(n)
b <- a
system.time(r_ply(10000, function() identical(a, b)))
}
adply(
data.frame(n=2 ^ seq_len(25)),
1,
function(n) id.test(n[1, ])
) -> timings
summary(lm(user.self~n, timings))
##
## Call:
## lm(formula = user.self ~ n, data = timings)
##
## Residuals:
## Min 1Q Median 3Q Max
## -0.001584 -0.000584 -0.000579 0.000416 0.005416
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 2.26e-02 3.73e-04 60.61 <2e-16 ***
## n -3.87e-11 4.81e-11 -0.81 0.43
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.00175 on 23 degrees of freedom
## Multiple R-squared: 0.0274, Adjusted R-squared: -0.0148
## F-statistic: 0.649 on 1 and 23 DF, p-value: 0.429
ggplot(timings) + geom_point(aes(x=n, y=user.self)) + scale_x_log10()