I am just learning R and working with the iclaims
data set from the bsts library. The data frame is of the form
claims
2004-01-04 2.536
2004-01-11 0.882
2004-01-18 -0.077
2004-01-25 0.135
2004-02-01 0.373
2004-02-08 -0.437
... ...
The short-term goal is to plot this data using ggplot2. However, I need to set the x-axis to the column containing the date, which has no header. I have been referring to this as the key column, but many Google searches seem to indicate that this the wrong term.
So this question really has three parts:
What is the column containing the dates called?
How do you extract this column? Output should read along the lines of
2004-01-04 2004-01-11 2004-01-18 2004-01-25 2004-02-01 2004-02-08 ...
When using ggplot2, how do you assign this column to x in the aes() argument?