I am using PypeR in my Python Application and want to get a variable from a R script.
My Python Application is as follows:
from pyper import *
r = R()
r.run("source('<PATH>/test.R')")
words = r.get("words", "No Variable found!", use_dict=False)
print (words)
The test.R is just like:
setwd("<PATH>")
words <- "Testword"
library(wordcloud)
If I run the application without including a library in test.R I get the response "Testword". Why if I include a library (doesn't matter which one), no variable "words" is found? I always get the fallback "No variable found".
I am using Python 3.5 and R 3.2.2 on my Windows 10 machine.
Solution: necessary to load dependent librarys first (R does this automatically, PypeR not). Ex.: