0

I have a string variable in my python code: apple = jo34

and would like to call an R function to perform the next step. However, my variable from python needs to be called. How can I do that?

There have been similar questions asked in the past but none seem to have answered this question directly.

This is not a duplicate of this question: link Because that link focuses on gsub

smci
  • 32,567
  • 20
  • 113
  • 146
hsayya
  • 131
  • 1
  • 10
  • @Chris_Rands You have any suggestions? I've tried robjects.r("{}".format()apple) – hsayya Feb 12 '19 at 21:47
  • It would be helpful to know what jo34 is an integer, a string, a list? – Ben373 Feb 12 '19 at 21:52
  • @Ben373 Oh yes, it's a string – hsayya Feb 12 '19 at 21:54
  • What do you want to do with the value once it's in R? The second answer (not the accepted one) would seem to let you pass any value into an R function. Is that not good enough? It would be easier to help with some sort of simple [reproducible example](https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example) with sample input and desired output that can be used to test and verify possible solutions. – MrFlick Feb 12 '19 at 22:43
  • @MrFlick I want to perform a poisson regression on the csv data in r. Thus that is the reason I wanted to read the csv files. That is the only reason I wanted to use r in the first place – hsayya Feb 12 '19 at 23:41

0 Answers0