I converted a pandas df to r using the the below:
import pandas as pd import pandas.rpy.common as com import rpy2.robjects as ro from rpy2.robjects.packages
As suggested by lgautier, it can be done with pandas2ri.
pandas2ri
Here is sample code for convert rpy dataframe (rdf) to pandas dataframe (pd_df):
rdf
pd_df
from rpy2.robjects import pandas2ri pd_df = pandas2ri.ri2py_dataframe(rdf)