How can I calculate data for a boxplot (quartiles, median) in a Rails app on Heroku? (Heroku uses Po
Posted
by hadees
on Stack Overflow
See other posts from Stack Overflow
or by hadees
Published on 2010-04-24T19:32:40Z
Indexed on
2010/04/24
19:53 UTC
Read the original article
Hit count: 304
I'm trying to calculate the data needed to generate a box plot which means I need to figure out the 1st and 3rd Quartiles along with the median. I have found some solutions for doing it in Postgresql however they seem to depend on either PL/Python or PL/R which it seems like Heroku does not have either enabled for their postgresql databases. In fact I ran "select lanname from pg_language;" and only got back "internal".
I also found some code to do it in pure ruby but that seems somewhat inefficient to me.
I'm rather new to Box Plots, Postgresql, and Ruby on Rails so I'm open to suggestions on how I should handle this. There is a possibility to have a lot of data which is why I'm concerned with performance however if the solution ends up being too complex I may just do it in ruby and if my application gets big enough to warrant it get my own Postgresql I can host somewhere else.
*note: since I was only able to post one link, cause I'm new, I decided to share a pastie with some relevant information
© Stack Overflow or respective owner