I am learning time series and started with converting data into tsibble object. Data contains three variables: Date ( in the form of 2020 05) showing year and month; Brands (as A, B, C) and Sales ( as quantity)
I was trying to do the following:
df <- df%>% mutate(Date = yearmonth(Date)) %>% as_tsibble(key = `Brands`, index = `Date`)
But I get this error:
Error: A valid tsibble must have distinct rows identified by key and index. i Please use
duplicates() to check the duplicated rows.
However, there are no duplicates in the data.
Thanks for your help!