westland <westl...@uic.edu> writes: > R still doesn't seem to recognize the data.frame ... I get a [6] ERROR: > object 'depy.w' not found from the following code: > > dep <- pls[,1:4] > ind <- pls[,5:8] > eqn <- data.frame(depy = dep, indx = ind) > apls <- plsr(depy.w + depy.h + depy.d + depy.s ~ indx.a + indx.i + indx.r + > indx.x, data=eqn) > > > BUT .... I DID try to cbind() these after add-concatenating them (not sure > exactly what I am doing) like so ... > > apls <- plsr(cbind(depy.w ,depy.h , depy.d , depy.s) ~ cbind(indx.a , indx.i > , indx.r,indx.x), data=eqn)
For creating multi-coloumn responses on-the-fly, using cbind() like this works. However, you don't need that for the predictors; there you can get by with just using '+'. If you only have a few predictors/responses, this will work okay, but if you have many, it will take a lot of typing, and make the formula handling part of plsr() take _ages_. Then using matrices is easier and faster. -- Bjørn-Helge Mevik ______________________________________________ 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.