'Creating boxplot based on three variables

How is it possible to create a box plot like this

data.frame(category = c(2, 3, 3, 3, 2, 2, 3, 3, 3, 3, 2, 3, 1, 3), educational_years = c(6, 15, 16, 6, 6, 6, 12, 12, 12, 4, 12, 15, 6, 4), gender = c("M", "F", "F", "F", "M", "M", "F", "M", "F", "F", "M", "F", "M", "F"))

from a data frame like this and x axis have the category y axis age and factor gender



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source