【发布时间】:2016-11-21 12:58:03
【问题描述】:
我在玩 do.call。
I = iris
do.call(what = "plot", args = c(I$Sepal.Length ~ I$Sepal.Width))
# This seems fine
p = list(x = I$Sepal.Length, y = I$Sepal.Width)
do.call(what = "plot", args = p)
# This looks weird
p1 = list(x = I$Sepal.Length, y = I$Sepal.Width, xlab = "")
do.call(what = "plot", args = p1)
# A bit less weird
p2 = list(x = I$Sepal.Length, y = I$Sepal.Width, xlab = "", ylab = "")
do.call(what = "plot", args = p2)
# And this gives the same as the first do.call
那么,为什么我必须提供轴标签来隐藏使用do.call 时得到的所有数字?
【问题讨论】:
-
@ZheyuanLi 那应该是
!=。前者调用plot.formula,后者调用plot.default。这就是轴标签不同的原因。 -
不,它们指的是轴标签。我怀疑他们甚至没有注意到切换 x 和 y 的问题。
-
我会写一个答案。