2017-01-18 108 views
0

我試圖在R中安裝pattern.nlp包,但有幾個錯誤正在經歷。這個軟件包用於python庫,所以我改變了環境變量的路徑。但在運行下面的代碼時,我收到錯誤。無法在R中安裝pattern.nlp包

$ 

x <- pattern_sentiment("i really really hate iphones", language = "english") 



Error in data.table::setDF(score) : 
    All elements in argument 'x' to 'setDF' must be of same length 
In addition: Warning messages: 
1: In pyConnectionCheck() : R isn't connected to Python! 

2: In pyConnectionCheck() : R isn't connected to Python! 

3: In pyConnectionCheck() : R isn't connected to Python! 

4: In pyConnectionCheck() : R isn't connected to Python! 


$ 

回答

0

檢查Python是否通過使用函數pyIsConnected()從R連接。如果沒有,則使用pyConnect()建立連接。

還要確保pattern.nlp軟件包安裝在Python中 - 請參閱http://www.clips.ua.ac.be/pattern