Building a multi column boxplot in r

Hello, guys, I am trying to build a multicolumn Boxplot using dataset crabs which was built in R.
I added a new factor with four levels, "spsex", which was a combination of sp and sex. In the Boxplot, I want to use the factor "spsex" as the x-axis, which means there will be four groups of box plot, and each group contains five columns of data, including " FL","RW","CL","CW","BD". The y value would be the values of those five factors. I could only get the plot of one factor, like this.

Here is my code.
boxplot (crabs_new$FL~crabs_new$spsex,data=crabs_new,
xlab = "crab type", ylab ="(mm)",
main = "Purple crab RW",
col = rainbow(5, s= 0.6),
cex.axis = 0.8)

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.