Boxplot
Boxplots allow to easily visualise factor levels within a variable
Basic code to make a boxplot with names on the X axis:
boxplot(one, two, names=list("one", "two"), col=c(2,4), main ='Boxplots of one and two))
Note the xlab
command does not work for boxplots.
names=list("one", "two")
is used instead.
This does not mean the x axis of a boxplot is not numbered. For example for pointing the coordinates of a legend, each box counts as 1 on the x axis.
Boxplots allow to easily visualise factor levels within a variable:
boxplot(one(data$sex=='M'), one(data$sex=='F'))