Retrieve tweets that contain a particular string.
- searchString – A character string of a username, not case-sensitive.
- n – The number of messages to retrieve.
Example. The Michigan (and Arizona) GOP primaries were last night and I hadn’t checked news sites before writing this post, so I queried Twitter to find the results.
> library(twitteR) Loading required package: RCurl Loading required package: bitops Loading required package: RJSONIO > result <- searchTwitter("Michigan", 10) > length(result)  10 > > result []  "ollybarratt: VIDEO: Romney wins key victories in Arizona and Michigan http://t.co/iQYeu19q our @simonmarksFSN reports on significance." []  "ShakoDjedi: http://t.co/ulixSHep Romney survives Michigan (from @cnn)" []  "sexxybeast1973: RT @GuardianUS: Mitt Romney's decisive Michigan win won't be enough to oust Obama http://t.co/JPcnJhxI" []  "legaleagle29: Michigan Fuels Fire! http://t.co/2bBYJLJ2" []  "toptw_nba: RT @umichbball: Michigan State's loss to Indiana keeps Michigan in the hunt for the B1G title. U-M needs to win out and OSU needs to defeat MSU #GoBlue" []  "Judigal: RT @pollinsider: Santorum not over-run in Michigan. Romn + PACs spent $3.1, Santo + PACs spent $2.1. Gap equalized by conserv radio and Dems 300K in anti-Rom" []  "CommieSOB: RT @LOLGOP: The good news is Michigan will get a chance to vote against Romney in November." []  "BarbieKayB: RT @Lakecrazy: for everyone saying Mitt won Michigan by 3%.. it was 2.7%. in his \"home\" state. Ladies and Gentlemen of up coming states, Please vote #Newt" []  "frankjg_jr: RT @DailyCaller: Mitt-chigan Man: Romney overtakes Santorum to win GOP primary - http://t.co/dAOboyjt" []  "kevinyrock: @kim_com45 I sort of figured haha. it's nasty outside this morning. At least up here in michigan it is"
Tip. Additional arguments may be specified to grab tweets in a certain date range or geographic area via since, until, and geocode.