def testMapperR2Python_s4(self):
     robjects.r('setClass("A", representation(x="integer"))')
     classname = rinterface.StrSexpVector(["A", ])
     one = rinterface.IntSexpVector([1, ])
     sexp = rinterface.globalenv.get("new")(classname, 
                                            x=one)
     self.assertTrue(isinstance(robjects.default_ri2py(sexp), 
                                robjects.RS4))
 def f(obj):
     pyobj = robjects.default_ri2py(obj)
     inherits = rinterface.baseenv["inherits"]
     classname = rinterface.SexpVector(["density", ], 
                                       rinterface.STRSXP)
     if inherits(pyobj, classname)[0]:
         pyobj = Density(pyobj)
     return pyobj
 def testMapperR2Python_environment(self):
     sexp = rinterface.globalenv.get(".GlobalEnv")
     self.assertTrue(isinstance(robjects.default_ri2py(sexp), 
                                robjects.Environment))
 def testMapperR2Python_function(self):
     sexp = rinterface.globalenv.get("plot")
     ob = robjects.default_ri2py(sexp)
     self.assertTrue(isinstance(ob, 
                                robjects.Function))
 def testMapperR2Python_boolean(self):
     sexp = rinterface.globalenv.get("T")
     ob = robjects.default_ri2py(sexp)
     self.assertTrue(isinstance(ob, 
                                robjects.Vector))
 def testMapperR2Python_string(self):
     sexp = rinterface.globalEnv.get("letters")
     ob = robjects.default_ri2py(sexp)
     self.assertTrue(isinstance(ob, 
                                robjects.RVector))