seAnswer-class: Class "seAnswer": A class to represent a StackExchange answer

Description Details Fields Methods Author(s) See Also Examples

Description

Provides a model representing answers from a StackExchange site

Details

The seAnswer class is implemented as a reference class. 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 seAnswerFactory. Accessor set & get methods are provided for every field using reference class $accessors() methodology (see setRefClass). As an example, the score field could be accessed with object$getScore() and object$setScore().

Fields

answerID:

Internal ID of the answer

accepted:

Logical, was the answer accepted

questionID:

ID of the question this answer was given to

creationDate:

POSIXct date of when this question was asked

lastActivityDate:

POSIXct date of the last activity associated with this answer happened

upVoteCount:

Number of up votes given

downVoteCount:

Number of down votes given

score:

Total score

owner:

The owner of the question, a seUser object

communityOwned:

Logical, is this a community wiki

title:

Title of the question this is answering

comments:

List of seComment objects that have been attached to this answer

body:

Text of the answer

site:

StackExchange site this answer belongs to

Methods

getQuestion:

Retrieves the seQuestion object that this is answering

Author(s)

Jeff Gentry

See Also

getAnswers, setRefClass

Examples

1
2
   zz <- getAnswers(num=2)
   bodies <- sapply(zz, function(x) x$getBody())

geoffjentry/RStackExchange documentation built on May 17, 2019, 1:11 a.m.