wiki_randomfact: Generate random facts from historic Wikipedia main pages

Description Usage Arguments Value Examples

View source: R/wiki_randomfact.R

Description

'wiki_randomfact()' generates random facts from Wikipedia main pages after 1 January 2015.

Usage

1
2
3
4
5
6
wiki_randomfact(
  n_facts = 1L,
  fact = c("any", "didyouknow", "onthisday", "inthenews"),
  bare_fact = FALSE,
  repeats = TRUE
)

Arguments

n_facts

An integer determining the number of facts that will be generated.

fact

String to determine the type of fact to be randomly generated - "any" will generate a random selection.

bare_fact

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

repeats

Logical. Determining if repeat facts should be permitted. If FALSE the number of facts may be less than requested.

Value

A vector of strings with random items from Wikipedia's main page - otherwise "I got nothin'"

Examples

1

wikifacts documentation built on April 29, 2021, 5:06 p.m.