File: dataframe.py

package info (click to toggle)
rpy 1.0.3-2
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 636 kB
  • ctags: 774
  • sloc: ansic: 2,139; python: 1,591; makefile: 119; sh: 73
file content (15 lines) | stat: -rw-r--r-- 385 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
from rpy import *
import erobj

class DataFrame(erobj.ERobj):
    def __init__(self, robj):
        erobj.ERobj.__init__(self, robj)

    def rows(self):
        return r.attr(self.robj, 'row.names')
    
    def __getattr__(self, attr):
        o = self.__dict__['robj']
        if attr in as_list(r.colnames(o)):
            return r['$'](o, attr)
        return self.__dict__[attr]