我期待上python
乳寧R代碼裏面:關鍵字不能
我已經安裝將R包robustbase
上ubunto使用apt-get install r-cran-robustbase
和RPY運行一些R
代碼的表達式錯誤消息packege以及。
從Python控制檯我可以成功運行from rpy import *
和r.library("robustbase")
但是當我運行
result = robjects.FloatVector([11232.1, 234.2, 3445532344.3, 34302.3, 203.9, 232223.3, 3434.55])
print(result.r_repr())
r(adjboxStats(c(11232.1, 234.2, 3445532344.3, 34302.3, 203.9, 232223.3, 3434.55), coef = 2.5, a = -4, b = 3, do_conf = TRUE, do_out = TRUE))
得到離羣值
但我得到這個錯誤:
adjboxStats(c(11232.1, 234.2, 3445532344.3, 34302.3, 203.9, 232223.3, 3434.55), coef = 2.5, a = -4, b = 3, do.conf = TRUE, do.out = TRUE)
SyntaxError: keyword can't be an expression
時我在R控制檯上運行它,它的工作原理!
library("robustbase")
adjboxStats(c(11232.1, 234.2, 3445532344.3, 34302.3, 203.9, 232223.3, 3434.55), coef = 2.5, a = -4, b = 3, do.conf = TRUE, do.out = TRUE)
我搜索here,here和here但沒有運氣。 沒有人知道這是什麼錯誤信息,是否有辦法繞過它?
謝謝!
您不能使用'do.conf'或'do.out'作爲Python函數的參數(即使該函數將被轉換爲R)。 –
正確,我必須使用do_conf和do_out對不對?我知道這麼多:) – mongotop
@mongotop:如果你已經知道,爲什麼不進行改變(這將修復此錯誤)而不是詢問? – abarnert