wiki_didyouknow {wikifacts}R Documentation

Generate 'did you know' facts from the Wikipedia main page on a specified date.

Description

‘wiki_didyouknow()' generates ’did you know' facts from the Wikipedia main page on a specified date.

Usage

wiki_didyouknow(
  n_facts = 1L,
  date = sample(seq(as.Date("2015-01-01"), Sys.Date() - 1, by = "day"), 1),
  bare_fact = FALSE
)

Arguments

n_facts

An integer determining the number of facts that will be generated, up to a limit of the maximum facts for the date specified.

date

A date string of the form YYYY-MM-DD. Default value is a random date since 1 January 2015.

bare_fact

Logical. Determining whether the fact should be quoted as is or surrounded by a preamble and courtesy statement.

Value

A vector of strings with random 'did you know' facts from Wikipedia's main page if it exists for the date specified - otherwise "I got nothin'"

Examples

wiki_didyouknow(n_facts = 2, date = '2020-05-02')

[Package wikifacts version 0.4.2 Index]