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

2015-01-26 Thread Bastien.Ferland-Raymond
lt stringAsFactors=T, but that's another debate. Anyway, thanks again, Bastien -Message d'origine- De : Ista Zahn [mailto:istaz...@gmail.com] Envoyé : 26 janvier 2015 11:51 À : Ferland-Raymond, Bastien (DIF) Cc : r-help@r-project.org Objet : Re: [R] Weird behavior of aggregate() fu

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

2015-01-26 Thread Ista Zahn
?aggregate informs you that unless x is a time series it will be converted to a data.frame. data.frame will convert your character to a factor unless you tell it not to. You can prevent this by converting vari to a data.frame yourself, passing the stringsAsFactors argument, like this: aggregate(d

[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