I keep trying to eliminate for loops when I arrive at them, but this one is stumping me. What is the nifty way to do this?
My object data.cca is the output of the cancor function (for some two datasets X and Y) (data.cca is a numeric vector) data.cca <- cancor(X,Y) Xcen=0*X for(i in 1:dim(X)[1]){ Xcen[i,]=data.cca$xcenter } Xc = X - Xcen ______________________________________________ R-help@r-project.org 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.