Error in generating boxplot two variable data frame: adding class “factor” to an invalid object
Your data type needs to be integer for your intent Output
Your data type needs to be integer for your intent Output
The error message is telling you the issue: you can’t use only factors to create a box plot. boxplot is looking for a numeric vector. Run code below as an example: see ?boxplot for examples on using formulas in the boxplot function, as that may be what you are looking for? For example:
We create the figure with the subplots: Where axes is an array with each subplot. Then we tell each plot in which subplot we want them with the argument ax. And the result is: