I want to compare between male basketball player's height and male football players's height by doing box plot. but there's some error occurred when plotting it.I read the data first
**> olympic<-read.table(file="olympic_height.txt", header=T)
names(olympic) [1] "height" "sport" "sex"
olympic height sport sex 1 170 Judo M 2 193 Athletics M 3 187 Athletics M 4 NA Boxing M 5 178 Athletics F 6 182 Handball M 7 182 Rowing F 8 187 Football M**
then I type these commands but there's mistake
**> B<- subset(olympic,sport=="basketball")
BM<- subset(B,sex=="M") boxplot(BM$height) Error in plot.window(xlim = xlim, ylim = ylim, log = log, yaxs = pars$yaxs) : need finite 'ylim' values In addition: Warning messages: 1: In min(x) : no non-missing arguments to min; returning Inf 2: In max(x) : no non-missing arguments to max; returning -Inf **
I tried another way but still doesn't work
**> BM <- subset(olympic,sport=="basketball" & sex == 'M')
boxplot(BM$height) Error in plot.window(xlim = xlim, ylim = ylim, log = log, yaxs = pars$yaxs) : need finite 'ylim' values In addition: Warning messages: 1: In min(x) : no non-missing arguments to min; returning Inf 2: In max(x) : no non-missing arguments to max; returning -Inf**
the same problem.I really don't know what is wrong? there's thousands of data set by the way not just those up.