boxplot

Auto fit labels in R boxplot

We are currently using R to automatically generate various kinds of boxplots. The problem we have is that the length our labels varies considerably between different plots and classes in one plot. Is there a way to automatically adjust the plot so that all the labels will fit it nicely? Specifying a worst case mar isn't feasible because...

help with boxplot needed

I am new to R, can anyone help me with boxplot for a dataset like: file1 col1 col2 col3 col4 col5 050350005 101 56.625 48.318 RED 051010002 106 50.625 46.990 GREEN 051190007 25 65.875 74.545 BLUE 051191002 246 52.875 57.070 RED 220050004 55 70 80.274 BLUE 220150008 75 ...

Boxplot in R showing the mean

Does anybody know of a way of generating a boxplot in R with a line (or another symbol) in the value corresponding to the mean? Thank you! ...

How can I calculate data for a boxplot (quartiles, median) in a Rails app on Heroku? (Heroku uses Postgresql)

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 datab...

String labels on boxplot outliers

Hi! I want to put string labels on outliers in a boxplot. Here's a simplification of the dataset I'm using: [,x] [,y] [,z] 7 2 a 10 2 b 112 3 c boxdata<-boxplot(x ~ y) To put values as label on outliers by group, I use this function: for(i in 1:length(boxdata$group)){ text(boxdata$group[i]...

Finding the highest, lowest, total, average and median from an array in Ruby

I am creating a boxplot generator in Ruby, and I need to calculate some things. Let's say I have this array: arr = [1, 5, 7, 2, 53, 65, 24] How can I find the lowest value (1), highest value (65), total (157), average (22.43) and median (7) from the above array? Thanks ...

jitter if multiple outliers in ggplot2 boxplot

I am trying to find a suitable display to illustrate various properties within and across school classes. For each class there is only 15-30 data points (pupils). Right now i am leaning towards a whisker-less boxplot, showing only 1.,2. and 3. quartile + datapoints more then e.g. 1 population SD +/- the sample median. This I can do. H...

ggplot: how to specify vertical order of multiple boxplots?

I would like to change the stacking order of hospitals in the diagram below so #1 is at the top and #4 at the bottom. The diagram was produced with ggplot(survey,aes(x=hospital, y=age))+geom_boxplot()+coord_flip()+xlab("")+ylab ("\nPatient Age") and I need the top->down order to be the reverse of what is now. I'm not sure why it com...

create a boxplot in R that labels a box with the sample size (N)

Is there a way to create a boxplot in R that will display with the box (somewhere) an "N=(sample size)"? The varwidth logical adjusts the width of the box on the basis of sample size, but that doesn't allow comparisons between different plots. FWIW, I am using the boxplot command in the following fashion, where 'f1' is a factor: boxpl...

How to place labels on top of each box in gnuplot?

Hi, I have an array of data which looks like this [0.5, 0.3, 0.15,0.0, 0.0, -0.09, -0.25,-0.4]. I wanted put a corresponding label (or number) of the boxes on top of the each box to indicate which one is which. Anybody knows how to do this ?? Thanks. ...

labels including an expression in cut function used in a boxplot in R

I'm using the cut function to convert a numeric variable into a factor with two levels and using this in a boxplot like this: boxplot(Sp$Var1 ~ cut(Spt$Var5, breaks = c(0,50,100), labels =c("below 50%", "above 50%")), ...) I want to include sample size as "n=..." below each of the labels used in the cut function. I can get the sample ...

R boxplot over summary

From the (simplified) data below that represents a user choosing between three options, I want to create a set of boxplots of the percentage of times a user chose a value, based upon the factor of value. So I want three boxplots, the percentage users chose 0, 1 and 2. I'm sure I'm missing something obvious, as I often do with R. I can g...

Joining means on a boxplot with a line (ggplot2)

I have a boxplot showing multiple boxes. I want to connect the mean for each box together with a line. The boxplot does not display the mean by default, instead the middle line only indicates the median. I tried ggplot(data, aes(x=xData, y=yData, group=g)) + geom_boxplot() + stat_summary(fun.y=mean, geom="line") This does ...