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

Andris Jankevics andza at osi.lv
Tue Aug 1 09:15:50 CEST 2006


Hello, I do this in such way:

DATAX <- matrix(seq(1,6,1),2,3)
DATAY <- matrix (seq(1,4,1),2,2)
rownames(DATAX) <- c("s1","s2")
rownames(DATAY) <- c("s1","s2")
colnames (DATAX) <- c("v1","v2","v3")
colnames (DATAY) <- c("respone_1","response_2")
KAL <- data.frame (N = rownames(DATAX))
KAL$Y <- DATAY
KAL$X <- DATAX
KAL$X
KAL$Y	

DATAX is a matrix of testing data, but DATAY is a matrix of responses.


Andris Jankevics

On Pirmdiena, 31. Jūlijs 2006 05:45, jz7 at 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 at 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.



More information about the R-help mailing list