R utils

Utils for using R with python in Jupyter

You need to install depending package with pip install rpy2 rpy2-arrow

See rpy2 for more details and rp2-arrow for arrow support.

TODO: support polars LazyFrame.


py2rpy_polars

 py2rpy_polars ()

Helper functions to convert between polars and R dataframes

Here is how you can use it, remember to load the extension first:

%load_ext rpy2.ipython
from ids_finder.utils.r import py2rpy_polars
conv_pl = py2rpy_polars()

Then you can use it like this to export a dataframe df to R:

%R -i df -c conv_pl