I would like to do a partial least square discriminant analysis (PLSDA) in R using the package “ropls”
In my PLSDA the impact of two genders (AP,C) on 5 compounds measured in persons (samples) should be illustrated.
However, when I try to do a PLSDA I get the warning message:
“Single component model: only 'overview' and 'permutation' (in case of single response (O)PLS(-DA)) plots available”
I assume it has something to do with the way I arrange my data into R. I tried to do it in a similar way as it has been done in the example of the package using the sacurine data set bioconductor.org/packages/release/bioc/vignettes/ropls/inst/doc/ropls-vignette.pdf
Can somebody maybe tell me how I correctly have to arrange my data in order to perfom a PLSDA using the “ropls” package?
Thank you very much,
Mike
Please find my code and the sessinInfo() below. since I had trouble with the language detector i could not upload an example data set. But I uploaded some screeshots of the data structure
CODE:
#Input data and convert to data frame and define "Sample" as row
dta<-read.csv("Demo.csv",sep=";",header=T)
rownames(dta)<-dta$Sample
dta
#Picture of data structure
#Remove non-numeric "Sample" and "Gender" rows and convert to matrix
dta.exp<-dta[,c(-1,-7)]
matrix<-as.matrix(dta.exp)
matrix
#Picture of matrix structure
#create vector with "gender" as y-component
dta.treatments<-dta[,7]
dta.treatments
dta.factor<-as.factor(dta.treatments)
dta.plsda <- opls(matrix, dta.factor)
SESSION INFO
sessionInfo()
R version 3.4.1 (2017-06-30)
Platform: i386-w64-mingw32/i386 (32-bit)
Running under: Windows 7 (build 7601) Service Pack 1
Matrix products: default
locale:
[1] LC_COLLATE=German_Switzerland.1252 LC_CTYPE=German_Switzerland.1252
[3] LC_MONETARY=German_Switzerland.1252 LC_NUMERIC=C
[5] LC_TIME=German_Switzerland.1252
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] ropls_1.8.0
loaded via a namespace (and not attached):
[1] compiler_3.4.1 parallel_3.4.1 tools_3.4.1 Biobase_2.36.2
[5] BiocGenerics_0.22.0