Commit 0193fcc7 authored by panos's avatar panos Committed by Jérome Perrin

New methods added in Transformations object

parent 71c5a598
......@@ -33,6 +33,24 @@ class BasicTransformations:
rsum = robjects.r['sum'] #Call sum function-R function
return rsum(data)[0]
def subtraction(self, data1, data2):
data1=robjects.FloatVector(data1)
data2=robjects.FloatVector(data2)
rsubtraction = data1.ro - data2
return list(rsubtraction)
def multiplication(self, data1, data2):
data1=robjects.FloatVector(data1)
data2=robjects.FloatVector(data2)
rmultiplication = data1.ro * data2
return list(rmultiplication)
def division(self, data1, data2):
data1=robjects.FloatVector(data1)
data2=robjects.FloatVector(data2)
rdivision = data1.ro / data2
return list(rdivision)
def scale(self, data): #centers around the mean and scales by the standard deviation (sd)
data=robjects.FloatVector(data)
rscale = robjects.r['scale'] #Call scale - R function
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment