No need for a for
loop, but you might want to take a look at both the twitteR
package vignette in a bit more detail and also review some of the samples over at the Twitter dev site:
bridgegate <- searchTwitter("bridgegate", n = 25)
# try not to use 't' as a variable name since there's a 't()' function
bridgeTweeters <- laply(bridgegate, function(x) x$getScreenName())
# this gets us **tons** of info about all the twitter users we found above
bridgeTweeters <- lookupUsers(bridgeTweeters)
# prlby 20 other ways to do the following
bridgeTweeters.250 <- as.character(na.omit((sapply(bridgeTweeters, function(x) {
return(ifelse((x$friendsCount <= 250), x$screenName, NA))
}))))
print(bridgeTweeters.250)
## [1] "SatireFunnyNews" "USRadioNews" "JOBCREMATORMITT" "__Semir__"
## [5] "TexasPolitica" "CallMeAhmjusAyn" "FoamFingerFan"