我正在尝试使用 R 中的绘图函数。我希望在 X 轴上表示的值在 Y 轴上,反之亦然。
我的另一个问题是我有一份约会清单。我想知道列表中有多少特定日期的实例。
我该怎么做呢?
1)
plot(y, x) # I'm guessing there is something you are not telling us.
在您使用带有单个“y”向量的默认索引的情况下,答案将是:
plot( x=y, y= 1:length(y) )
# This was reversed when it was posted as an edit-response to the comment.
2)
table(dates)[as.Date("YYYY-MM-DD")] # with the obvious substitutions