fortunes {fortunes}R Documentation

R Fortunes

Description

Read and print R fortunes.

Usage

  fortune(which = NULL, fortunes.data = NULL)
  ## S3 method for class 'fortune':
print(x, width = NULL, ...)
  read.fortunes(file = NULL)

Arguments

which An integer specifying the row number of fortunes.data. Alternatively which can be a character and grep is used to try to find a suitable row.
fortunes.data A data frame containing a fortune in each row. By default the fortune data from the fortune package are used.
x An object of class "fortune", usually a single row from fortunes.data.
width Integer specifying the character width. By default getOption("width") is used.
... Currently not used.
file A character string giving a fortune database in csv format (in UTF-8 encoding). By default all csv files in the data directory of the fortune package are used.

Value

fortune() returns an object of class "fortune" which is a row from a data frame of fortunes (like those read in from read.fortune).

read.fortune() returns a data frame of fortunes, each row contains:
quote the quote, main part of the fortune,
author the author of the quote,
context the context in which it was quoted (if available, otherwise NA),
source where it was quoted (if available, otherwise NA),
date when it was quoted (if available, otherwise NA).

Examples

fortune()
fortune("Ripley")
fortune(17)

[Package fortunes version 1.3-7 Index]