Quantcast
Channel: Active questions tagged r - Stack Overflow
Viewing all articles
Browse latest Browse all 201945

Problem with calling an R package in Python

$
0
0

For context: My goal is to create a graphic interface so that the user can run a program that I have been developing in R. The interface is done using the Tkinter module from python (version 3.3). Right now I am trying to make it work in Windows.

I believe I have successfully called the R interpreter using python to run my R file (run.R). In this file I call the R package 'seqinr'. However when I call the R interpreter from python I obtain this:

I run this:

os.system('C:/"Program Files"/R/R-3.6.1/bin/Rscript run.R')

and I obtain this:

Error in library(seqinr) : there is no package called 'seqinr'
Calls: source -> withVisible -> eval -> eval -> library
Execution halted

However, when I run the 'C:/"Program Files"/R/R-3.6.1/bin/Rscript run.R' command in the Command Prompt, it works perfectly and I have no problems. I also checked where my package is installed and it's in the default directory that R uses to install all the packages. I also do not have any other R versions installed in my machine.

I have no clue what is happening now, so I would appreciate any help.

Thank you!


Viewing all articles
Browse latest Browse all 201945

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>