-1

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.

user16217248
  • 3,119
  • 19
  • 19
  • 37

1 Answers1

0

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")
Alez
  • 1,913
  • 3
  • 18
  • 22
  • Hello ALez,i have tried the way you have said but still the problem persists. it says the following "RRuntimeError: Error in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]) : there is no package called 'fitdistrplus' ". – Sai Bargav May 12 '23 at 04:37
  • Your error now is different because related to a different library. So you solved the issue on qmap and you're missing the fitdistrplus lib. Please, follow my answer and add another piece of code replacing 'qmap' with 'fitdistrplus'. – Alez May 12 '23 at 07:28
  • @SaiBargav did you solve your issue? – Alez May 12 '23 at 13:49
  • Thank you for your reply. I have tried as you told me, but the error remains the same. I have also tried installing the fitdistrplus in the R environment it says it is successfully installed. The error that is being displayed is as follows "Error in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]) : there is no package called 'fitdistrplus' " – Sai Bargav May 15 '23 at 04:43