【发布时间】:2013-08-26 12:15:34
【问题描述】:
为什么下面的代码在 x 轴上绘制点 1:10 而不是 0:9?
(我知道我可以用不同的代码来解决问题,不过,我想知道。)
y <- rep(1,10)
for (i in 1:10) {
if (i == 1) {
plot(y[i]~(i-1),pch = 14,
ylim = c(0,2),
xlim=c(0,11))
}
else {points(y[i]~(i-1), pch = 14)
}
}
【问题讨论】: