Function returning None with pyper

237 Views Asked by At

I tried to create a function for the following

from pyper import *
import pandas as pd

r=R(use_pandas=True)
r.assign('xN', 5)
r.assign('yN', 3)
r('out1 <- xN + yN')
print(r.get('out1'))
8

created function

def addR(x, y):
    r=R(use_pandas=True)
    r.assign('xR', x)
    r.assign('yR', y)
    return r('out <- xR + yR')

addR(5, 3)
r=R(use_pandas=True)
print(r.get('out'))
None

is returning None

0

There are 0 best solutions below