On Apr 11, 2011, at 23:53 , Joris Meys wrote:
Based on a discussion on SO I ran some tests and found that converting
to a factor is best done early in the process. Hence, I propose to
rewrite the gl() function as :
gl2 - function(n, k, length = n * k, labels = 1:n, ordered = FALSE){
rep(
Thanks for the explanation, I wasn't fully aware of which optimization
I was using. I reckon your solution is more R-sound, so no reason to
keep with my bizarre workaround. It would be nice though if gl() got
optimized. Thank you for the example too, I'm learning every day.
Cheers
Joris
On Tue,
On Apr 12, 2011, at 10:33 , Joris Meys wrote:
Thanks for the explanation, I wasn't fully aware of which optimization
I was using. I reckon your solution is more R-sound, so no reason to
keep with my bizarre workaround. It would be nice though if gl() got
optimized. Thank you for the example
Based on a discussion on SO I ran some tests and found that converting
to a factor is best done early in the process. Hence, I propose to
rewrite the gl() function as :
gl2 - function(n, k, length = n * k, labels = 1:n, ordered = FALSE){
rep(
rep(