0
我正嘗試使用ROCR軟件包從分析中導出生物測量數據。以下是我迄今爲止完成的代碼:如何從ROCR軟件包導出數據
pred = performance(Matching.Score,Distribution)
perf = prediction(pred,"fnr", "fpr")
An object of class 「performance」
Slot "x.name":
[1] "False positive rate"
Slot "y.name":
[1] "False negative rate"
Slot "alpha.name":
[1] "Cutoff"
Slot "x.values":
[[1]]
[1] 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000
[15] 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000
......
Slot "y.values":
[[1]]
[1] 1.00000 0.99999 0.99998 0.99997 0.99996 0.99995
[15] 0.99986 0.99985 0.99984 0.99983 0.99982 0.99981
......
Slot "alpha.values":
[[1]]
[1] Inf 1.0427800 1.0221150 1.0056240 1.0032630 0.9999599
[12] 0.9644779 0.9633058 0.9628996 0.9626501 0.9607665 0.9605930
.......
這會導致出現多個插槽。我想用所得的值導出到Excel的修改文本文件:
write(pred, "filename")
然而,當我嘗試寫文件時,我得到一個錯誤,指出:
Error in cat(list(...), file, sep, fill, labels, append) :
argument 1 (type 'S4') cannot be handled by 'cat'
是有沒有辦法解決這個問題?
我會很感激任何建議。謝謝!
馬特·彼得森
該訣竅。我錯過了結構論證。非常感謝你! – 2009-11-12 07:07:31