Best technique for timelines

前端 未结 2 925
囚心锁ツ
囚心锁ツ 2021-02-06 07:42

Now that Gaddafi\'s 40+ years rule has ended, I want to construct a timeline graph of his period in power with those of other countries over the era. e.g US presidents, German c

2条回答
  •  独厮守ぢ
    2021-02-06 08:08

    You could construct a set of sparse, irregular zoo or xts timeseries with one for each group of related events to annotate (US presidents in one, chancellors in another). The index column would be the date and the value would be the character annotation. You've then got your choice of charting libs. With Lattice you'd be able to split it into one panel per group.

    Alternately you could just construct a single regular timeseries of the years he was in power with some bogus values for each data point. Plot that with a transparent line just to setup the base plot that you'd then add your annotations to. You could use abline or similar.

    Another quicker way might be this http://www.inside-r.org/packages/cran/googleVis/docs/gvisAnnotatedTimeLine http://code.google.com/apis/chart/interactive/docs/gallery/annotatedtimeline.html#Example

提交回复
热议问题