The best technique for deadlines

Now that Gaddafi’s law has ended for 40 years, I want to build a timeline for my period, which was in power with those from other countries in the era. for example, US presidents, German chancellors, etc. Thus, the x axis will be time, the countries of the y axis and the timeline - at the correct time frame - showing Nixon, Ford, etc. For the USA.

Since I'm trying to learn R, I would prefer a solution in this language, but I have the feeling that this is not the best solution. Any suggestions for this or alternative, free solutions?

I should probably add that if in R the dataframe starts up

Country Boss TookCharge USA Nixon 1969-01-20 USA Ford 1974-08-09 Germany Brandt 1969-10-22 Germany Schmidt 1974-05-16 
+7
source share
2 answers

This is a simple task for ggplot :

Create some data:

 x <- data.frame( country = rep(c("USA", "Germany"), each=2), boss = c("Nixon", "Ford", "Brandt", "Schmidt"), start = as.Date(c("1969-01-20", "1974-08-09", "1969-10-22", "1974-05-16")) ) 

Make a plot:

 library(ggplot2) ggplot(x, aes(x=start, y=country)) + geom_line() + geom_point() + geom_text(aes(label=boss), hjust=0, vjust=0) + xlim(c(min(x$start), max(x$start)+5*365)) # Add some space to right 

enter image description here

+5
source

You could build a set of sparse, irregular zoos or xts timeouts, one for each group of related events, to annotate (US presidents in one, chancellors in another). The index column will be the date, and the value will be the symbol annotation. Then you have a choice of graphic libraries. Using the grill, you can divide it into one panel per group.

Alternatively, you could simply create a single regular timeout of the years when he was in power, with some dummy values ​​for each data point. A plot with a transparent line to customize the base plot that you added to your annotations. You can use abline or the like.

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

+4
source

All Articles