Hi,

I am trying to do the following aggregation :


data <- data.frame(a=rep(2,10),b=rep("a",10)) aggregate(data$a, by=list(a1=data$a, b1=data$b), NROW)

but I have the following error message


Error in "names<-.default"(`*tmp*`, value = c(names(by), names(x))) :
names attribute [3] must be the same length as the vector [2]
In addition: Warning message:
row names were found from a short variable and have been discarded in: data.frame(w, lapply(y, unlist, use.names = FALSE))


It works if there are more than 2 modalities in data$b. I can test if there is only one modality of course but there is no reason for the function not working in this particular case.


I use R 1.9.0 under Solaris


--
Philippe Hupé
UMR 144 - Service Bioinformatique
Institut Curie
Laboratoire de Transfert (4ème étage)
26 rue d'Ulm
75005 Paris - France
        
Email :  [EMAIL PROTECTED]
Tél :    +33 (0)1 44 32 42 75
Fax :    +33 (0)1 42 34 65 28

______________________________________________
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html

Reply via email to