I am summarising the evidence cited by different trials in their reference sections. I want to display the earliest and most recent cited papers on a chart along with the year of publication of the actual trial. I have tried solutions using ggplot, base plot function, and googleVis, but with no luck.
What I want is sort of like a Gantt chart, with the name of the trials on y-axis and the years (yyyy) on the x-axis. I've run into trouble because most Gantt chart code out there works on Dates, and also can't handle the three elements I need on the chart -
Earliest reference
Latest reference
Date of publication
poorly drawn postit of what I'm trying to achieve
Update: This is close to what I want, and this code works very well, thank you. I'm glad you did it in ggplot too, i'm used to that package.
I also need to add a third class (pubdate) onto the chart, so the df is
df <- structure(list(task = structure(1:3, .Label = c("Trial1", "Trial2", "Trial3"),
class = "factor"), start_year = c(1980, 2003, 2000),
end_year = c(2006, 2013, 2010), pub_date = c(2011, 2015, 2013)),
class = "data.frame",
row.names = c(NA, 3L))
I would like pub_date to be separated from the start_year<->end_year line on the graph.