Exemple #1
0
 def __init__(self, seq):
     """ 
     """
     if isinstance(seq, Sexp):
         super(self, Vector)(seq)
     else:
         for elt in seq:
             if not isinstance(elt, struct_time):
                 raise ValueError('All elements must inherit from time.struct_time')
         as_posixlt = baseenv_ri['as.POSIXlt']
         origin = StrSexpVector([time.strftime("%Y-%m-%d", 
                                               time.gmtime(0)),])
         rvec = FloatSexpVector([mktime(x) for x in seq]) 
         sexp = as_posixlt(rvec, origin = origin)
         self.__sexp__ = sexp.__sexp__
Exemple #2
0
 def __init__(self, obj):
     obj = FloatSexpVector(obj)
     super(FloatVector, self).__init__(obj)
Exemple #3
0
def tuple_str(tpl):
    return FloatSexpVector(tpl)