Skip to content

Instantly share code, notes, and snippets.

@ahmaurya
Created July 19, 2016 19:16
Show Gist options
  • Save ahmaurya/05a545925f967fe7b147c67b45718ced to your computer and use it in GitHub Desktop.
Save ahmaurya/05a545925f967fe7b147c67b45718ced to your computer and use it in GitHub Desktop.
Creates a timeline of prominent Urdu poets
library('googleVis')
dd <- read.csv(header = TRUE, text = "Birth,Death,Poet,City
1797,1869,Mirza Ghalib,Delhi
1722,1810,Mir Taqi Mir,Lucknow
1831,1905,Daag Dehlvi,Delhi
1911,1984,Faiz Ahmed Faiz,Lahore
1800,1851,Momin Khan Momin,Delhi
1877,1938,Muhammad Iqbal,Lahore
1918,2002,Kaifi Azmi,Mumbai
1756,1817,Insha Allah Khan,Lucknow
1846,1921,Akbar Allahabadi,Allahabad
1916,1970,Shakeel Badayuni,Mumbai
1921,1980,Sahir Ludhianvi,Mumbai")
dd <- within(dd, {
end <- as.POSIXct(strptime(Death, format="%Y"), origin = '1970-01-01')
start <- as.POSIXct(strptime(Birth, format="%Y"), origin = '1970-01-01')
})
plot(gvisTimeline(dd, rowlabel = 'City', barlabel = 'Poet', start = 'start', end = 'end', options = list(width=1000, height=1000)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment