Rpy2 and drawing pie diagram

Here is code that I come up with for drawing a pie diagram using rpy2. The function takes two lists. Function takes two lists: data contains frequencies and labels labels. The argument title set the title text of chart. Radius sets the radius of pie (max 1.0). Font size 1 is default, 1.5 is 50%Continue reading “Rpy2 and drawing pie diagram”

Calculating correlation with rpy2

I spend some time trying to figure out how to use R via Rpy2. Here are a short python code that I used to calculate correlation using Rpy2 import rpy2.robjects as robjects def get_rcorr(floatData, n_rows, method=”spearman”): “”” floatData: list of floats, number of rows in the data matrix Hmisc library needs to be loaded beforeContinue reading “Calculating correlation with rpy2”