RRuntimeError: Error in loadNamespace(name) , displays there is no package called 'qmap'

53 Views Asked by At

Screenshot of error that I am facing

I have tried importing qmap tool from R in Jupyter Notebook. All the functions that I have imported from R in Jupyter aren't giving any error however the qmap gives an error.

How to solve this error of importing qmap, I have tried various methods i.e. checking various versions of R and Anaconda whether they are compatible or not, but the problem still persists.

1

There are 1 best solutions below

4
Alez On

You're missing to install the package qmap.

You can install it in R with install.packages("qmap") or in Python with rpy2.robjects.r('install.packages("qmap")')

So, in your case, you can write in Python this code:

import rpy2.robjects as ro
try:
    pkg = importr("qmap")
except:
    ro.r(f'install.packages("qmap")')
    pkg = importr("qmap")