Struggling to work out if I'm using xts correctly to create Time series with unequal time intervals

Trying to create a time series from real data from EV charging points with POSIXct and charge time. Data covers a period of several years, but I am looking to analyse one year. Encountering two errors firstly when I create the xts object, and attempt to use decompose to assess seasonality :
Error in decompose(X) : time series has no or less than 2 periods

and secondly when I try to create an acf for the ts:
Error in if (frequency > 1 && 0 < (d <- abs(frequency - round(frequency))) && :
missing value where TRUE/FALSE needed

My data, as it is real has readings at uneven time intervals (hundreds of thousands of charge events across a year), and i would expect it to exhibit seasonality in weekly, daily, monthly intervals etc. I am not specifying a frequency when creating xts, which could be the source of the first error.

any help would be appreciated, I am new to R and this probably is a fairly fundamental error(s) .


Welcome to the RStudio community!

In order for us to help you with your question, please provide us a minimal reproducible example where you provide a minimal (dummy) dataset and code that can recreate the issue. Once we have that, we can go from there. For help on creating a Reprex, see this guide:

Good luck!

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.