userTimeline (twitteR package)

userTimeline(user, n=20)
Retrieve a specific user’s most recent posts on Twitter.
  • user – A character string of a username.
  • n – The number of messages to retrieve.

Example. Below I grab the most recent tweets by PLoS ONE and RFunction (the latter being me).
> library(twitteR)
Loading required package: RCurl
Loading required package: bitops
Loading required package: RJSONIO
> po <- userTimeline("PLoSONE", n=5)
> po[[1]]
[1] "PLoSONE: Patterns and perceptions of 
#climatechange in biodiversity conservation hotspot 
Kibale National Park in Uganda"
> rf <- userTimeline("RFunction", n=5)
> rf[[1]]
[1] "RFunction: publicTimeline (twitteR package) -
Retrieve the 20 most recent tweets on Twitter."
> length(rf)
[1] 5

Leave a Reply