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”
Category Archives: R
rpy2 and plotting
I had a problem to plot in R or rpy2 when I started the R on Terminal on Mac OSX (R works fine if started by clicking it on Lauchpad ). R throws an following error if locale is set to C. Error in axis(side = side, at = at, labels = labels, …) :Continue reading “rpy2 and plotting”
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”