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