小编wil*_*now的帖子

在 rpy2 中处理 Null 返回

我正在使用 rpy2 从 python 调用 R 函数。

from rpy2.robjects import *
result=r.someFunctioninR()   #someFunctioninR is a R function written by myself
if result==r('as.null()'):
     do something
else:
     do something else
Run Code Online (Sandbox Code Playgroud)

返回的“结果”someFunctioninR()可以是NULL或其他格式。result==r('as.null()')不起作用。当结果为 NULL 时,还有其他方法可以得到 True 吗?

python r rpy2

5
推荐指数
1
解决办法
3393
查看次数

标签 统计

python ×1

r ×1

rpy2 ×1