Esempio n. 1
0
import rpy3.robjects.methods
import rpy3.robjects as robjects
import rpy3.robjects.conversion as conversion
from rpy3.robjects.packages import importr
import copy

#getmethod = robjects.baseenv.get("getMethod")

rimport = robjects.baseenv.get('library')
ggplot2 = importr('ggplot2')

ggplot2_env = robjects.baseenv['as.environment']('package:ggplot2')

StrVector = robjects.StrVector

def as_symbol(x):
   res = robjects.baseenv["parse"](text = x)
   return res

class GGPlot(robjects.RObject):

    _constructor = ggplot2_env['ggplot']
    _rprint = ggplot2_env['print.ggplot']
    _add = ggplot2_env['+.ggplot']

    @classmethod
    def new(cls, data):
        res = cls(cls._constructor(data))
        return res
    
    def plot(self, vp = robjects.NULL):
Esempio n. 2
0
import rpy3.robjects.methods
import rpy3.robjects as robjects
import rpy3.robjects.conversion as conversion
from rpy3.rlike.container import OrdDict
from rpy3.robjects.packages import importr


#getmethod = robjects.baseenv.get("getMethod")

grid = importr('grid')

grid_env = robjects.baseenv['as.environment']('package:grid')


layout  = grid.grid_layout
newpage = grid.grid_newpage
grill   = grid.grid_grill
edit    = grid.grid_edit
get     = grid.grid_get
remove  = grid.grid_remove
add     = grid.grid_add
xaxis   = grid.grid_xaxis
yaxis   = grid.grid_yaxis


class Grob(robjects.RObject):
    """ Graphical object """
    _grob = grid_env['grob']
    _draw = grid_env['grid.draw']

    def __init__(self, *args, **kwargs):