library(plotGoogleMaps)


locs<-read.table('locations_test2.csv')
time<-read.table('dateTime_test2.csv')
#text<-read.table('text_test2.txt',sep='\n')
#text<-read.table('text_test2.csv')
text<-read.table("text_test2.txt",sep='\n',header=FALSE,allowEscapes=TRUE,fill=TRUE,strip.white=FALSE,colClasses="character")


#time series
tseries=strptime(paste(time[,3],time[,2],time[,6]), '%d %b %Y')


#lat longs
y<-locs[seq(2,nrow(locs),by=2),1]
x<-locs[seq(1,nrow(locs),by=2),1]
ll<-data.frame(x,y,date=tseries,text=text[,1])


use<-which(tseries<strptime('18 Feb 2013','%d %b %Y'))

ll.plot<-ll[use,]

coordinates(ll.plot)<-~x+y
proj4string(ll.plot)<-CRS('+proj=longlat +ellps=WGS84 +towgs84=0,0,0,0,0,0,0 +no_defs')

plotGoogleMaps(ll.plot)
