getQuestions: Functions to manipulate StackExchange questions

Description Usage Arguments Details Value Author(s) See Also Examples

Description

These functions interact with the question functionality of the StackExchange API

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
getQuestions(num = NULL, ids = NULL, fromDate = NULL, toDate = NULL, min = NULL, max = NULL,
             sort = NULL, order = NULL, tagged = NULL, site = "stackoverflow.com")
getUnansweredQuestions(num = NULL, fromDate = NULL, toDate = NULL, min = NULL, max = NULL,
             sort = NULL, order = NULL, tagged = NULL, site = "stackoverflow.com")
getNoAnswerQuestions(num = NULL, fromDate = NULL, toDate = NULL, min = NULL, max = NULL,
             sort = NULL, order = NULL, tagged = NULL, site = "stackoverflow.com")
getQuestionLinks(num = NULL, ids = NULL, fromDate = NULL, toDate = NULL, min = NULL, max = NULL,
             sort = NULL, order = NULL, site = "stackoverflow.com")
getQuestionRelated(num = NULL, ids = NULL, fromDate = NULL, toDate = NULL, min = NULL, max = NULL,
             sort = NULL, order = NULL, site = "stackoverflow.com")

Arguments

num

An upper bound on the number of results to return

ids

A vector of numeric IDs representing a specific subset of questions to search

fromDate

When present, an early bound on results to return, either as a POSIXct date or an Unix timestamp

toDate

When present, an upper bound on results to return, either as a POSIXct date or an Unix timestamp

min

When present, minimum value for the current sort

max

When present, maximum value for the current sort

sort

When present, how results are to be sorted, one of activity (default), creation or votes

order

When present, how results should be ordered, one of desc (default) or asc

tagged

An optional vector of tags to limit the search space

site

Which StackExchange site to query

Details

The getQuestions function is a standard search for questions.

The getUnansweredQuestions function will limit the search to questions which are considered unanswered. This means that there are no answers with at least one upvote for the question.

The getNoAnswerQuestions function will limit the search to questions which have no answers.

The getQuestionLinks function will return any questions which link to the questions represented by ids

The getQuestionRelated function will return questions which are deemed related to those identified by ids

Value

A list of seQuestion objects

Author(s)

Jeff Gentry

See Also

seQuestion

Examples

1
2
3
4
5
6
7
8
   zz <- getQuestions(num=2, fromDate=as.POSIXct('2009-09-25'), toDate=as.POSIXct('2010-05-30'))
   ids <- sapply(zz, function(x) x$getQuestionID())
   getQuestionRelated(num=3, ids=ids)

   xx <- getNoAnswerQuestions(num=3)
   yy <- getUnansweredQuestions(num=2)
   getQuestionLinks(ids=sapply(yy, function(x) x$getQuestionID()))
 

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