rpy2
OSError: cannot load library ‘C:\Program Files\R\R-4.0.2\bin\x64\R.dll’: error 0x7e
Here is my working solution: import os os.environ[“R_HOME”] = r”D:\Install\R\R-3.6.1″ os.environ[“PATH”] = r”D:\Install\R\R-3.6.1\bin\x64″ + “;” + os.environ[“PATH”] import rpy2 from rpy2.robjects import pandas2ri, packages pandas2ri.activate() stats = packages.importr(‘stats’)
Converting python objects for rpy2
You need to add import rpy2.robjects.numpy2ri rpy2.robjects.numpy2ri.activate() See more in rpy2 documentation numpy section (here for the older 2.x version) Prior to 2.2.x the import alone was sufficient. That import alone is sufficient to switch an automatic conversion of numpy objects into rpy2 objects. Why make this an optional import, while it could have been … Read more
rpy2 install on windows 7
OK. From previous experience I’ve found there are not many instructions on how to install rpy2 on Windows. I get that it’s not officially supported but it’s really not that hard. In a few steps I’ll show what I did and maybe others can follow. These instructions will most likely only work for Python 2.7+ … Read more
Controlling the order of points in ggplot2?
2016 Update: The order aesthetic has been deprecated, so at this point the easiest approach is to sort the data.frame so that the green point is at the bottom, and is plotted last. If you don’t want to alter the original data.frame, you can sort it during the ggplot call – here’s an example that … Read more