On Thu, Jul 8, 2010 at 3:14 PM, Addi Wei <addi...@gmail.com> wrote: > > Hopefully simple question: What is the best way to name, and treat factor > columns for data that has lots of columns? > > This is my column list: > id pID50 D.1 D.2 D.3 D.4 D.5 , etc. all the way to D.185 > It would be much better to use a factor and let R itself generate the set of dummy variables. Choose a useful name. For example if D stands for Dose, then use something like
micetitletest$Dose <- factor(micetitletest$dose.values) miceD <- plsr(pID50 ~ Dose, ncomp=10, data = micetitletest) Read about factors in the online An Introduction to R distributed as part of R. [[alternative HTML version deleted]] ______________________________________________ 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.