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