Stefanie von Felten, IPW&IfU wrote: > Hi everyone, > > Is it possible to use tapply(x,y,mean) if not all groups of x by y are > of the same length (for example if you have one missing observation)? > > I tried tapply(x,y,mean,na.omit=T) but it doesn't work!
See ?tapply which tells you that the argument "..." is passed to FUN which is mean() in this case. mean() has an argument "na.rm", see ?mean. So we get: tapply(x, y, mean, na.rm = TRUE) Please read the help pages more carefully. Uwe Ligges > Steffi ______________________________________________ [email protected] mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
