Question: how to use rpy2 in python?
Answer: pip install rpy2==2.3.0. from numpy import * import scipy as sp. from pandas import * from rpy2.robjects.packages import importr. ...  envr = datasets.data.fetch('mtcars') rdf = com.convert_to_r_dataframe(df) formula = 'mpg ~ wt + cyl' ro.r('plot(mtcars$mpg, mtcars$wt)') print(ro.r('identify(mtcars$mpg, mtcars$wt)'))