-3

I am trying to plot a boxplot in R, and I can't see the boxes, below shows what i see:

enter image description here

and here is the code i am writing:

ggplot(data=FIR,
  aes(x=as.factor(FIR$Revised.Status),y=as.numeric(FIR$Diff_Date_Requested)))+
  geom_boxplot(fill="blue", alpha=0.2)+xlab("Status")

Revised.Status: is the results of the request it is A or C

Diff_Date_Requested: is the difference between 2 dates

C8H10N4O2
  • 18,312
  • 8
  • 98
  • 134

1 Answers1

1

From ?geom_boxplot:

The lower and upper hinges correspond to the first and third quartiles (the 25th and 75th percentiles).

If your 25th percentile and 75th percentile are the same value, or are really close together, you won't see the box, just a single line.

It looks like you might be working with count data or other integer values. If more than half your y-values are 1 (i.e., whatever it is happens the next day, so difference = 1), that might explain it.

You might want to think about other ways of visualizing count data, like geom_bar().

C8H10N4O2
  • 18,312
  • 8
  • 98
  • 134