On Wed, 2007-03-28 at 19:55 -0200, Alberto Monteiro wrote: > Prof Brian Ripley wrote: > > > > We have already seen three solutions. > > > > I don't like to see the use of c() for its side effects. In this > > case Marc's as.vector seems to me to be self-explanatory, and that > > is a virtue in programming that is too often undervalued. > > > I agree; but for our enlightnment, what are the side effects of > c()? > > Alberto Monteiro
I believe that Prof. Ripley is referring to the following, from the Details section in ?c: "c is sometimes used for its side effect of removing attributes except names, for example to turn an array into a vector. as.vector is a more intuitive way to do this, but also drops names." There are also examples in ?c of this behavior. HTH, Marc ______________________________________________ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.