My data set "olympics" has 4 columns: case number, height, sport, and sex (female=F, male=M), and each row corresponds to an athlete.
I need to produce a box plot comparing the height distributions among the male basketball players and male football players. (Both sports on a single plot, but with no others.)
I have tried
boxplot(olympics$height[olympics$sex == "M" & olympics$sport %in% c("basketball", "football")])
but I keep getting errors saying that finite ylim
values are needed. How would you get the correct boxplot?
Going to rewrite this since I found your data set and figured out what your issue was. You have a ton of typos. R is case sensitive. Run this code and it will produce the boxplots that you want.