status-class: Class to contain a Twitter status

Description Details Fields Methods Author(s) See Also Examples

Description

Container for Twitter status messages, including the text as well as basic information

Details

The status class is implemented as a reference class. This class was previously implemented as an S4 class, and for backward compatibility purposes the old S4 accessor methods have been left in, although new code should not be written with these. An instance of a generator for this class is provided as a convenience to the user as it is configured to handle most standard cases. To access this generator, use the object statusFactory. Accessor set & get methods are provided for every field using reference class $accessors() methodology (see setRefClass for more details). As an example, the screenName field could be accessed using object$getScreenName and object$setScreenName.

The constructor of this object assumes that the user is passing in a JSON encoded Twitter status. It is also possible to directly pass in the arguments.

Fields

text:

The text of the status

screenName:

Screen name of the user who posted this status

id:

ID of this status

replyToSN:

Screen name of the user this is in reply to

replyToUID:

ID of the user this was in reply to

statusSource:

Source user agent for this tweet

created:

When this status was created

truncated:

Whether this status was truncated

favorited:

Whether this status has been favorited

retweeted:

TRUE if this status has been retweeted

retweetCount:

The number of times this status has been retweeted

Methods

toDataFrame:

Converts this into a one row data.frame, with each field representing a column. This can also be accomplished by the S4 style as.data.frame(objectName).

Author(s)

Jeff Gentry

See Also

userTimeline, setRefClass

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
   ## Not run: 
     st <- statusFactory$new(screenName="test", text="test message")
     st$getScreenName()
     st$getText()

     ## Assume 'json' is the return from a Twitter call
     st <- statusFactory$new(json)
     st$getScreenName()
   
## End(Not run)
   

twitteR documentation built on May 2, 2019, 6:46 a.m.