2017-08-02 49 views
0

我相信有一種方法可以在不編寫R腳本的情況下在Spotfire中生成相關值,但是我想了解爲什麼下面的代碼沒有在Spotfire中運行。我也嘗試將統計信息和基礎庫加載到Spotfire中無濟於事。如何使用R腳本在Spotfire中生成相關值

下面的腳本是:

output <- cor(input1, input2)

錯誤消息如下:

TIBCO Enterprise Runtime for R returned an error: 'Error in library(pkg, character.only = TRUE) : there is no package called 'correlation''.

+0

嘗試'統計:: COR(輸入1,輸入2)'? – Stedy

+0

這是有效的!謝謝Stedy! –

回答

1

請告訴我最有可能的情況是,Tibco的具有預安裝的軟件包叫做相關掩蓋功能cor()。從統計庫調用它:

stats::cor(input1,input2)