【问题标题】:rpy2, package 'outliers' functions not workingrpy2,包“异常值”功能不起作用
【发布时间】:2016-09-29 07:03:06
【问题描述】:

我对 R`s 包中的几乎所有函数都有一个问题:异常值。 正常工作的“选择一个”功能是异常值

list_ = ['chisq.out.test','cochran.test', 'dixon.test', 
         'grubbs.test', 'outlier',  'qcochran']
y = some data without brackets like 0.0, 0.0, 0.0, 0.48416666667,
for f in list_:
try:
    code = """ y=c({0});
           require(outliers);
           {1}(y);""".format(y, f)

我收到消息:

找不到函数“complete.cases”

我也试过了:

y = FloatVector([0.0, 0.0, 0.0, 0.48416666667, 0.48716666667])
outliers = importr('outliers')
outliers.outlier(y) //works
outliers.cochran.test(y) //not working -> syntax is different

您有什么建议,我该如何解决? 在此先感谢

【问题讨论】:

    标签: python r rpy2 outliers


    【解决方案1】:

    在 R 中,“点”可以用在变量名中。它不能在 Python 中。

    importr 正在尝试帮助解决此问题,如下所述: http://rpy2.readthedocs.io/en/version_2.8.x/robjects_rpackages.html

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2018-03-20
      • 1970-01-01
      • 2018-08-25
      • 1970-01-01
      • 2013-03-30
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多