My question is actually very simple. I have a string, say:
In : strg Out: 'I want to go home'
and I want to pass it to R through
robjects.r(''' ''') like this, for example:
robjects.r(''' test <- gsub("to", "",strg) ''')
but of course, when I run this I obtain:
Error in gsub("me", "", strg) : object 'strg' not found.
I have not used
rpy2 much (as obvious) but I guess is related to the environments in which R and Python see the objects.
I have tried a few things, like transforming the string
strg to an
robject first and then feed it to
robjects.r(''' ''') but I get the same error message. Overall, I do not know how do this so that
strg is seen at the
Any help is much appreciated!
Thanks in advance for your time!