Displaying 1 result from an estimated 1 matches for "subdad".
Did you mean:
subdat
2009 Jun 26
5
(performance) time in Windows vs Linux
...,replace=FALSE), rpois(N,30)))
names(dad) = c("id","age")
aux = as.data.frame(cbind(sample(N,n,replace=FALSE), round(runif(n),4)))
names(aux) = c("id","score")
#calculates time
set.seed(790) #to be equal to everyone
system.time({
dad$score = 0
subdad = subset(dad, id%in%aux$id)
for(k in 1:(dim(subdad)[1])){
temp = aux$score[aux$id==subdad$id[k]]
if(length(temp)) subdad$score[k] = temp
}
})
#windows time
# user system elapsed
# 27.81 0.00 27.82
#linux usual compilation time
# user system elapsed
# 52.635 ...