How might I plot month to month growth for the following data:
A
2008-07-01 0
2008-08-01 87
2008-09-01 257
2008-10-01 294
2008-11-01 325
2008-12-01 299
(In dput format, before Joshua hunts me down and murders me in my sleep):
structure(c(0L, 87L, 257L, 294L, 325L, 299L), .indexCLASS = c("POSIXt",
"POSIXct"), .indexTZ = "", index = structure(c(1214884800, 1217563200,
1220241600, 1222833600, 1225512000, 1228107600), tzone = "", tclass = c("POSIXt",
"POSIXct")), .Dim = c(6L, 1L), .Dimnames = list(NULL, "A"), class = c("xts",
"zoo"))
Define growth: first difference? Percentages? In either case just compute and then plot:
You can also use a standard line plot:
and change the
type=argument of this plot to show bars etc pp. Normally would plot percentage changes but given your first datapoint this is inadmissible here (as noted by Gavin) so diffs it is for this illustration.