0

I am making a plotly plot with this data from 538. The dates are organized but when I produce a plot (dates as x-axis), it starts with October, then November, then July, and then it's finally in order.

This is all I am doing for code right now.

plot_ly(weather, x = ~date, y = ~actual_min_temp)

1 Answer 1

2

Before plotting, make sure your date data is converted to a date class. This error can happen when the date data is a character class instead, for example. To convert data to a date class, you can try using one of these:

weather <- as.Date(weather$date)

#or

weather <- as.POSIXct(weather$date)

Then try plotting again.

Sign up to request clarification or add additional context in comments.

1 Comment

I was trying to do that, but I think I didn't enter it in right. It worked thank you so much!! Spent over 2 days on this oh boy, but thank you!!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.