Re: [R] question about dataframe ("sensory") in PLS package

From: Gabor Grothendieck <ggrothendieck_at_gmail.com>
Date: Mon 31 Jul 2006 - 13:09:55 EST

Try:

?sensory
str(sensory)
dput(sensory)
lapply(sensory, class)
lapply(sensory, dim)

to see what it looks like inside. Seems that sensory is a data frame consisting of two columns each of which is a matrix except that each has a class of "AsIs". Thus try this (where I(...) creates objects of class "AsIs"):

mat1 <- cbind(a = 1:5, b = 11:15)
mat2 <- cbind(x = 21:25, y = 31:35)
DF <- data.frame(A = I(mat1), B = I(mat2))

On 7/30/06, jz7@duke.edu <jz7@duke.edu> wrote:
> Dear all,
>
> I am trying to my dataframe for the PLS analysis using the PLS package.
> However I have some trouble generating the correct dataframe. The main
> problem is how to use one name to represent several columns in the
> dataframe.
>
> The example dataframe in PLS package is called "sensory". I cannot
> directly read the data file since it's a binary file. If I use
> "names(sensory)" command, I will get two names: "Quality" and "Panel". But
> if I use "summary(sensory)" command, I will get information of five
> columns for "Quality" and 6 columns for "Panel" (such as "Quality.Acidity"
> "Quality.Peroxide"...). So when I use PLS regression, the function is
> simply "Panel ~ Quality" (but it's actually multiple regression).
>
> Does anyone know how to build such dataframe? Please share some
> experience. Really appreciate the help!
>
> Sincerely,
> Jeny
>
> ______________________________________________
> 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.
>



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. Received on Mon Jul 31 13:28:07 2006

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Mon 31 Jul 2006 - 14:18:47 EST.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.