I have the following code:
x = rnorm(30, 1, 1)
c = c(rep("x1",10), rep("x2",10), rep("x3",10))
df = dataframe(x,c)
boxplot(x ~ c, data=df)
It works great. But if I decide I am no longer interested in seeing x3, remove it, and replot:
dfMod = subset(df, c %in% c("x1", "x2"))
boxplot(x ~ c,data=dfMod)
The boxplot still shows a column for x3.
Ive tried giving boxplot a hint using
boxplot(x~c,data=dfMod, names = c("x1", "x2"))
but this throws the error that names size is not right. Thanks in advance for the help