from rpy2 import robjects
robjects.r("""                         
source('quadro.R')
""")
quadro = robjects.globalenv['quadro']
quadro(3)
quadro(3)[0]
Using an R-script in python, which was written for R