I've been trying to transform a dataframe I put together into a Time Series, but for some reason it doesn't work. I am very new to R.
    x<-Sales_AEMBG%>%
+   select(Ecriture.DatEcr, Crédit, Mapping)
> names(x)<-c("Dates","Revenue","Mapping")
> str(x)
Classes ‘tbl_df’, ‘tbl’ and 'data.frame':   15167 obs. of  3 variables:
 $ Dates  : POSIXct, format: "2016-01-02" "2016-01-02" "2016-01-02" "2016-01-02" ...
 $ Revenue: num  124065 214631 135810 225293 57804 ...
 $ Mapping: chr  "E.M 1.5 L" "E.M 1.5 L" "E.M 1.5 L" "E.M 1.5 L" ...'
When I try to look at the data, here's what I have
> head(x)
# A tibble: 6 x 3
  Dates               Revenue Mapping  
  <dttm>                <dbl> <chr>    
1 2016-01-02 00:00:00 124065. E.M 1.5 L
2 2016-01-02 00:00:00 214631. E.M 1.5 L
3 2016-01-02 00:00:00 135810. E.M 1.5 L
4 2016-01-02 00:00:00 225293. E.M 1.5 L
5 2016-01-02 00:00:00  57804. E.M 1.5 L
6 2016-01-02 00:00:00 124065. E.M 1.5 L
Of course, I tried the as.ts function
 > x_xts <- as.ts(x)
Warning message:
In data.matrix(data) : NAs introduced by coercion
> is.ts(x)
[1] FALSE
But it keeps telling me that my dataframe is still not recognized as a TS.
What do you suggest ?
Thanks