Frequency In Time Series In R