來求個助,請各位點開看看畫PCA圖的數(shù)據(jù)導(dǎo)入問題

我用ropls包畫PCA, PLS DA, OPLS DA圖,但是數(shù)據(jù)導(dǎo)入出了些問題。

> data

sample calss X.2.methoxyethoxy.propanoic.acid X.gamma.Glu.Leu.Ile

1? asss1? ? 1? ? ? ? ? ? ? ? ? ? ? ? ? ? ? 6.8? ? ? ? ? ? ? ? 5.9

2? asss2? ? 1? ? ? ? ? ? ? ? ? ? ? ? ? ? ? 3.5? ? ? ? ? ? ? ? 3.6

3 assss3? ? 1? ? ? ? ? ? ? ? ? ? ? ? ? ? ? 3.6? ? ? ? ? ? ? ? 3.8

4? asss4? ? 1? ? ? ? ? ? ? ? ? ? ? ? ? ? ? 2.8? ? ? ? ? ? ? ? 3.9

5 assdd4? ? 2? ? ? ? ? ? ? ? ? ? ? ? ? ? ? 4.7? ? ? ? ? ? ? ? 4.1

6? sdv6? ? 2? ? ? ? ? ? ? ? ? ? ? ? ? ? ? 4.6? ? ? ? ? ? ? ? 4.2

7? ghj7? ? 2? ? ? ? ? ? ? ? ? ? ? ? ? ? ? 4.5? ? ? ? ? ? ? ? 4.3

8? fdg9? ? 2? ? ? ? ? ? ? ? ? ? ? ? ? ? ? 4.4? ? ? ? ? ? ? ? 5.1

我的數(shù)據(jù)導(dǎo)入后是這樣的,但是運行畫圖命令后出來了個error:

> pca <- opls(data)

Error: 'x' data frame must contain columns of 'numeric' vectors only

然后我就把first and second column刪掉(因為第二列數(shù)據(jù)沒用),沒想到出現(xiàn)一個

warning:

> data.exp <- data[,c(-1, -2)]

> pca <- opls(data.exp)

Warning message:

Single component model: only 'overview' and 'permutation' (in case of

single response (O)PLS(-DA)) plots available

也順帶出來了一些數(shù)據(jù)和一個圖,結(jié)果這個圖是空白,只有橫縱坐標

> pca

PCA

8 samples x 3 variables

standard scaling of predictors

R2X(cum) pre ort

Total? ? 0.704? 1? 0

我問作者是不是數(shù)據(jù)有什么格式要求,就按照上面的格式給作者郵件,作者回復(fù):

The model tells you that one component is sufficient (ie the second one is

not bringing useful information).

If, however, you want to compute additional components (ie 2 components to

display the score plot), you can set the predI argument (eg to 2 or more

instead of the NA default value).

他說一個成分足夠了,但是我沒有得到圖怎么辦呢?加主成分這個建議在SIMCA軟件里面也

有,不過我用別的包(muma包)不需要加主成分做出的PCA圖有3個主成分,只是只能出圖,

沒有上面那些R2X數(shù)據(jù)。

我該怎么修改我的數(shù)據(jù)格式好呢?如有描述不足或者不當請多多指教

最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時請結(jié)合常識與多方信息審慎甄別。
平臺聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點,簡書系信息發(fā)布平臺,僅提供信息存儲服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容