Learn R Programming

twitteR (version 0.99.2)

user-class: A container object to model Twitter users

Description

This class is designed to represent a user on Twitter, modeling information available

Arguments

Details

The user 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, user the object userFactory. 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 user. It is also possible to directly pass in the arguments.

See Also

status, setRefClass

Examples

Run this code
## This example is run, but likely not how you want to do things
   us <- userFactory$new(screenName="test", name="Joe Smith")
   us$getScreenName()
   us$getName()

   ## Assume 'json' is the return from a Twitter call
     us <- userFactory$new(json)
     us$getScreenName()

Run the code above in your browser using DataLab