I am new to R. I am running Jupyter Lab on a Windows 11 machine, and have created a virtual environment where I installed some packages and irkernel. I get the following message when I execute %load_ext rpy2.ipython: Here is my complete code: Apart from the environment variables, the above code comes from David Mertz book “Cleaning Data for Effective
Tag: rpy2
Calling an R package function with rpy2
I’m new to R and need to pass string data from a pandas dataframe to a function in R. This function accepts nested lists of strings, such as: The code I tried two approaches: 1) That yielded KeyError: <class ‘list’> error message. 2) That yielded the error message: I checked if d is a list or not: I’d be grateful
For loop is several times faster in R than in Python using the rpy2 library
The following simply for block takes about ~3 sec to complete in R: The same code run in Python through the rpy2 library takes between 4-5 times more: Is this just because I’m using the rpy2 library to communicate with R or is there something else at play? Can this be improved in any way […]
How to plot (inline) with rpy2 in Jupyter notebook?
I’m learning to use rpy2 in Jupyter notebook. I’m having troubles with the plotting. When I use this example from the rpy2 docs for interactive work: Jupyter opens a new window with the plot. The window “title” reads: R Graphics: Device 2 (ACTIVE) (Not Responding). My Jupyter kernel is active. When I try to close […]