directMessage-class(twitteR)
directMessage-class()所属R语言包:twitteR
Class "directMessage": A class to represent Twitter Direct Messages
“directMessage类:A类来表示Twitter的直接消息
译者:生物统计家园网 机器人LoveR
描述----------Description----------
Provides a model representing direct messages (DMs) from Twitter
从Twitter提供了一个模型代表直接消息(DMS)
Details
详细信息----------Details----------
The directMessage class is implemented as a reference class. As there should be no backwards compatibility issues, there are no S4 methods provided as with the user and status classes. 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 dmFactory. Accessor set & get methods are provided for every field using reference class $accessors() methodology (see setRefClass for more details). As an example, the sender field could be accessed using object$getSender() and object$setSender().
directMessage作为参考类类实现。应该没有向后的兼容性问题,有没有S4user和status类提供的方法。这个类的一个实例生成器,用于提供给用户一个方便,因为它被配置为处理最标准的情况下。要访问此生成器,使用对象dmFactory。访问器组和get方法为各个领域提供使用引用类$accessors()方法(见setRefClass为更多细节)。作为一个例子,sender域可以访问使用object$getSender()和object$setSender()。
The constructor of this object assumes that the user is passing in a JSON encoded Twitter Direct Message. It is also possible to directly pass in the arguments.
这个对象的构造函数假定用户是在一个JSON编码Twitter的直接消息传递。另外,也可以直接通过在参数中。
字段----------Fields----------
text: Text of the DM
text:文本的DM
recipient: A user object representing the
recipient:Auser对象代表
recipientSN: Screen name of the recipient
recipientSN:屏幕收件人的名字
recipientID: ID number of the recipient
recipientID:身份证号码的收件人
sender: A user object representing the sender
sender:A user对象代表发送者
senderSN: Screen name of the sender
senderSN:屏幕的发件人姓名
senderID: ID number of the sender
senderID:发送方的ID号
created: When the messages was created
created:当消息被创造
方法----------Methods----------
destroy: Deletes this DM from Twitter. A wrapper
destroy:这从Twitter DM删除。一个包装
toDataFrame: Converts this into a one row data.frame, with each field representing a column. This can also be accomplished by the S4 style
toDataFrame:将其转换成一排data.frame,每个字段表示列。这也可以通过S4的风格
(作者)----------Author(s)----------
Jeff Gentry
参见----------See Also----------
dmGet, dmSend, dmDestroy, setRefClass
dmGet,dmSend,dmDestroy,setRefClass
实例----------Examples----------
## This example is run, but likely not how you want to do things[#这个例子运行,但可能不是如何你想要做的事情]
dm <- dmFactory$new(text='foo', recipientSN='blah')
dm$getText()
## Not run: [#不运行:]
## assume 'json' is the return from a Twitter call[#假设的JSON是从Twitter的呼叫回报]
dm <- dmFactory$new(json)
dm$getSenderID()
## End(Not run)[#(不执行)]
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|