Let's start with a simple sample data set with a series of dates and quantities:
Next, if the date data is not already in a date format, we'll need to convert it to date format:
Next we need to create variables stating the week and month of each observation. For week, cut has an option that allows you to break weeks as you'd like, beginning weeks on either Sunday or Monday.
Finally, we can create either a line or bar plot of the data by month and by week, using stat_summary to sum up the values associated with each week or month:
|Time series plot, binned by month|
|Time series plot, totaled by week|
The full code is available in a gist.