I imagine this is a very simple question, but I'm trying to plot a time series in Plotly (R) and everytime I try to plot - the lines are automatically assuming the y axis (i.e. facing horizontally).
From what I understand, this is a problem relating to how my variables are being input into the code. But not entirely sure how to solve this issue...
Assuming this is to do with my variables, I've printed the structure of my dataset below:
Classes ‘tbl_df’, ‘tbl’ and 'data.frame': 53 obs. of 2 variables:
$ Date.received: Date, format: "2017-06-29" "2017-06-22" "2017-05-16" "2017-06-23" ...
$ n : num 20 17 14 13 12 12 12 11 11 11 ...
My Plotly code is as follows:
plot_ly(Time, x = Date.received, y = n, mode = "line")
The outcome is:
Many thanks in advance, apologies for the rookie question!