[R] Coding your Secret Santa in R!

2015-12-01 Thread Bastien.Ferland-Raymond
Hello Everyone! Christmas is coming and with it, gift exchange! Every year, with my family, we draw names from a hat to decide who gives a gift to who. Very basic and annoying method, as it doesn't prevent somebody to draw himself, to draw his/her partner, to draw years after years the same p

Re: [R] Weird behavior of aggregate() function

2015-01-26 Thread Bastien.Ferland-Raymond
Thanks Ista for youe help, it works and I understand why. However, I'm still confuse why the previous code lost the "factor key". It could just have converted to factors and output factors but instead it's outputing integer... I'm not a very big fan of the default stringAsFactors=T, but that's

[R] Weird behavior of aggregate() function

2015-01-26 Thread Bastien.Ferland-Raymond
Hello list, I have found a weird behavior of the aggregate() function when used with characters. I think the problem as to do with converting characters to factors. I'm trying to aggregate a character vector using an homemade function. My function is giving me all the possible pairs of modali

[R] bad label change in step() from lmerTest package

2014-12-16 Thread Bastien.Ferland-Raymond
Hello list, I recently started working with the step() function in the lmerTest package and I notice a weird behavior that may be a bug. The package perform stepwise selection of fixed and random effects, however when it discard the random variable because not significant, it changes the label

Re: [R] column width in .dbf files using write.dbf ... to be continued

2013-05-22 Thread Bastien.Ferland-Raymond
Hello Arnaud, You posted this question a long long time ago, however I found your answer so I decided to post it anyway in case somebody else have the same problem as you and me. You were actually very close in finding your solution. The function DoWritedbf is an internal function from the f

[R] Modifying values into XML with R

2012-04-26 Thread Bastien.Ferland-Raymond
Dear R gurus, I use R all the time at work, so one day a problem managing my personal arise data made me think: "Why not use R, it does everything!". Anyway, my goal is to use R to manage my personal music library, and more precisely my playcounts. I have two XML files, one from Winamp and the

[R] optimising a loop

2011-11-03 Thread Bastien.Ferland-Raymond
Dear R community, I'm trying to remove a loop from my code but I'm stock and I can't find a good way to do it. Hopefully one of you will have something clever to propose. Here is a simplified example: I have a squared matrix: > nom.plac2 <- c("102", "103", "301", "303","304", "403") > poids2