-3

I want to plot a boxplot. I really did some research before raise a question at here. At first I tried in Excel but it caused laggy due to the data is so large. So, I decided to R.

My data consist of 180 of 100x2 data frame. So, it has 180000 rows.

Means, I have 100's of A, 100's of B, and so so.

How can I plot a boxplot that have A, B, C,... so on together in R?

enter image description here

My desired outcome (but want to have D..E..F..together)

enter image description here

How can I do that in R? Need help...

jpsmith
  • 11,023
  • 5
  • 15
  • 36
Gambit
  • 77
  • 1
  • 11
  • 5
    How many groups are in your data set? 180,000 rows isn't a problem, but visualizing what sounds like more than a thousand boxplots in a plot is going to be messy. – Seth Jul 31 '23 at 14:16
  • 3
    Also, please don't upload code, error messages, results or data as images for [these reasons](https://meta.stackoverflow.com/questions/285551/why-not-upload-images-of-code-errors-when-asking-a-question/285557#285557) - and [these](https://xkcd.com/2116/). – Limey Jul 31 '23 at 14:41

1 Answers1

1

I agree with the comments. you can easily find this by searching, unless I am misunderstanding what you want. Also, please provide you code or data. Below, I created random data to show the skeleton of what you would do for a clustered boxplot.

letters <- c('A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J')

data <- data.frame(Type = sample(letters, 200, replace = TRUE),
                   Delta = runif(200, min = -0.05, max = 0.2))

ggplot(data, aes(x = Type, y = Delta, fill = Type)) +
  geom_boxplot() +
  labs(title = "Type vs. Delta",
       x = "Type", y = "Delta") +
  theme_minimal()

Clustered Boxplot

amanwebb
  • 380
  • 2
  • 9