I'm having trouble understanding the mapping to the rpy2 object and the python object.
I have a function (x) that returns a tuple object in python, and I want to map this tuple object using a list or object vector R.
First I try to do this:
# return a python tuple into this r object tlist robjects.r.tlist = get_max_ticks(x)
FAIL with error: rinterface.RRuntimeError: error in eval (expr, envir, enc): object 'tlist' not found
So I'm trying to use a different strategy:
robjects.r["tlist"] = get_max_ticks(x) r('x <- as.data.frame(tlist,row.names=c("seed","ticks"))')
This error fails: TypeError: object 'R' does not support element assignment
Could you help me understand? Many thanks!
source share