Calling R script from python using 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 robjectsr = robjects.rr['source']('script.R')
or
import rpy2.robjects as robjectsr = robjects.rr.source('script.R')
r[r.source("script.R")]
is a wrong way to do it.
Same idea may apply to the next line.