Q:

Trying to count number of times a year is in a timestamp in R

I have posted the code that we are using and it is a pretty quick run.  I am supposed to figure out this question.
How many events in the dataset occurred in 2011?
None of the timestamps have that date, but the column lastModified does.  I am trying to use this code to return a 1 if 2011 and 0 if not, but they all return 0s.  Please help!
theData$year2011 <- ifelse(theData$lastModified == "2011*", 1,0)

That is the code that doesn't work.  Here is the code to set up data
require(rjson)
require(plyr)

dataPath <- "http://getglue-data.s3.amazonaws.com/getglue_sample.tar.gz"

theCon<-gzcon(url(dataPath))

n.rows <- 1000
theLines <-readLines(theCon, n=n.rows)

str(theLines)
theLines[1]
theRead<-lapply(theLines[-1],fromJSON)

theData<-ldply(theRead,as.data.frame)

View(theData)

A:

theData$year2011 <- ifelse(grepl('^2011.*', theData$lastModified), 1,0)

