我正在根据plot()
R 中使用的因子绘制连续变量(参见下面的示例)。我不想要轴上的标签。如果没有as.factor
公式中的调用会ann = F
抑制标签的打印,但它在公式中不起作用as.factor
。
为什么是这样?
谢谢你。
# example for SO
# example data
x <- sample(1:100, 10)
y <- c(rep(1, 5), rep(2, 5))
# ann = F doesn't work here
plot(x ~ as.factor(y), ann = F)
# ann = F does work here
plot(x ~ y, ann = F)