[R] data structure for plsr

Bricklemyer, Ross S rsb at wsu.edu
Tue Oct 16 20:02:49 CEST 2007


I am working with NIR spectral data and it was great to find that the example in ?plsr also used spectral data.  Unfortunately, I am having difficulty figuring out how the "yarn" dataset is structured to allow for the plsr model to read: 

yarn.oscorespls <- mvr(density ~ NIR, 6, data = yarn, validation = "CV", method = "oscorespls")



Specifically, it is VERY convenient to be able to have the ~256 variables to be used in the model defined by NIR term.  When I use dim(yarn) it claims [1] 28  3.  When I call "yarn" there is WAY more data than 28  3.  How does this work?  I have 186 spectral bands to run in plsr and I would really like to be able to call them using NIR or something simlar.  I have tried labeling my spectral data ASD.###, where ### is the wavelength, but I keep getting data.frame errors.


Ross Bricklemyer
Dept. of Crop and Soil Sciences
Washington State University
291D Johnson Hall
PO Box 646420
Pullman, WA 99164-6420
Work: 509.335.3661
Cell/Home: 406.570.8576
Fax: 509.335.8674
Email: rsb at wsu.edu


More information about the R-help mailing list