CommunityData:Exporting from Python to R: Difference between revisions

From CommunityData
(Created page with "I run a cell like this at the top: # import code to write r modules and create our variable we'll write to import rpy2.robjects as robjects from rpy2.robjects import panda...")
 
No edit summary
Line 5: Line 5:
  from rpy2.robjects import pandas2ri
  from rpy2.robjects import pandas2ri
  pandas2ri.activate()
  pandas2ri.activate()
  r = {}
  r = {}
  def remember(name, x):
  def remember(name, x):
     r[name] = x
     r[name] = x
     display(x)
     display(x)

Revision as of 23:33, 25 August 2016

I run a cell like this at the top:

# import code to write r modules and create our variable we'll write to
import rpy2.robjects as robjects
from rpy2.robjects import pandas2ri
pandas2ri.activate()
r = {}
def remember(name, x):
    r[name] = x
    display(x)