更新时间:2022-06-19 01:37:01
源
是 r
函数,运行 r
源文件。因此,在 rpy2
中,我们有两种调用方式:
source
is a r
function, which runs a r
source file. Therefore in rpy2
, we have two ways to call it, either:
import rpy2.robjects as robjects
r = robjects.r
r['source']('script.R')
或
import rpy2.robjects as robjects
r = robjects.r
r.source('script.R')
r [ r.source( script.R)]
是错误的处理方式。
r[r.source("script.R")]
is a wrong way to do it.
相同的想法可能适用于下一行。
Same idea may apply to the next line.