Apologies for not using the correct "lingo", I don't know what it's called:
I have a table made up of data that represents participants' numeric responses to questions. The data table looks like the sample below (obviously shortened for clarity):
participant q1 q2 q3 q4 .... q10
1 2 1 3 5 .... 2
2 3 2 4 1 .... 4
3 1 2 4 2 .... 3
.
.
50 2 3 5 2 .... 5
So what I want to do is create a boxplot in ggplot that puts question number along the x axis, and score up the side. I know how to do a boxplot with just ONE question, but how can I do it for all ten?
If I do this:
susQBoxPlot <-ggplot(susQuestions, aes(x = participant, y = q1, group = 1))
+ geom_boxplot()
susQBoxPlot
Then I get this:
But where do I go from here? I thought I could just add the extra columns to the "y =" part of the aes, like this:
susQBoxPlot <-ggplot(susQuestions, aes(x = participant, y = q1, q2, group = 1))
+ geom_boxplot()
But it just gives me the same output.
Next I tried this:
susQBoxPlot <-ggplot(susQuestions, aes(x = participant, y = c(q1, q2), group = 1))
+ geom_boxplot()
susQBoxPlot
But I just get the following error:
Error: Aesthetics must be either length 1 or the same as the data (50): y
Whatever that means!
I've tried looking in ggplot documentation but I can't see anything that even remotely looks like what I'm trying to do.
And yes, I am aware that r has a built in boxplot() function, but I don't want to use that because I want my box plots and bar plots to have the same style, and I don't like the way the barplot() function in r works!