I am having a problem with the following date frame in which I want to pass the "vendas" column to an object of type time series.
head(base3)
# A tibble: 6 x 4
# Groups: trimestre, ano [6]
trimestre ano Código.do.Produto vendas
<int> <dbl> <fct> <dbl>
1 3 2009 S3 7300
2 1 2010 S3 7900
3 2 2010 S3 50700
4 3 2010 S3 20900
5 2 2011 S3 12000
6 3 2011 S3 2300
i'm trying this:
baseaux<-base3%>%filter(ano==min(base3$ano))
ts<-ts(base3[,4],start=c(min(base3$ano),min(baseaux$trimestre)),frequency=4)
and i'm getting this:
Qtr1 Qtr2 Qtr3 Qtr4
2009 7300 7900
2010 50700 20900 12000 2300
2011 15000 35000 30000 0
2012 10300 35000 50000 60000
2013 90000 111400 80000 30900
2014 46400 21700 32300 2500
2015 1800 5000 300000 38000
2016 42000 68000 27900 229500
2017 12100 243000 180300 283000
2018 137000
the date in the time series is being created on a continuous basis of time. But, I do not have the data frame data that way. How do I fix this?