| Title: | R Fortunes |
|---|---|
| Description: | A collection of fortunes from the R community. |
| Authors: | Achim Zeileis [aut, cre] (ORCID: <https://orcid.org/0000-0003-0918-3766>, R code), R Community [aut] (fortunes), Peter Dalgaard [ctb], Uwe Ligges [ctb], Kevin Wright [ctb], Martin Maechler [ctb], Kjetil Brinchmann Halvorsen [ctb], Kurt Hornik [ctb], Duncan Murdoch [ctb], Andy Bunn [ctb], Ray Brownrigg [ctb], Roger Bivand [ctb], Spencer Graves [ctb], Jim Lemon [ctb], Christian Kleiber [ctb], David L. Reiner [ctb], Berton Gunter [ctb], Roger Koenker [ctb], Charles Berry [ctb], Marc Schwartz [ctb], Michael Dewey [ctb], Ben Bolker [ctb], Peter Dunn [ctb], Sarah Goslee [ctb], Simon Blomberg [ctb], Bill Venables [ctb], Roland Rau [ctb], Thomas Petzoldt [ctb], Rolf Turner [ctb], Mark Leeds [ctb], Emmanuel Charpentier [ctb], Chris Evans [ctb], Paolo Sonego [ctb], Peter Ehlers [ctb], Detlef Steuer [ctb], Tal Galili [ctb], Greg Snow [ctb], Brian D. Ripley [ctb], Michael Sumner [ctb], David Winsemius [ctb], Liviu Andronic [ctb], Brian Diggs [ctb], Matthieu Stigler [ctb], Michael Friendly [ctb], Dirk Eddelbuettel [ctb], Richard M. Heiberger [ctb], Patrick Burns [ctb], Dieter Menne [ctb], Andrie de Vries [ctb], Barry Rowlingson [ctb], Renaud Lancelot [ctb], R. Michael Weylandt [ctb], Jon Olav Skoien [ctb], Francois Morneau [ctb], Antony Unwin [ctb], Joshua Wiley [ctb], Terry Therneau [ctb], Bryan Hanson [ctb], Henrik Singmann [ctb], Eduard Szoecs [ctb], Gregor Passolt [ctb], John C. Nash [ctb], Thierry Onkelinx [ctb], Ron Ammar [ctb], Joshua Ulrich [ctb], Michael Meyners [ctb], John Sorkin [ctb] |
| Maintainer: | Achim Zeileis <[email protected]> |
| License: | GPL-2 | GPL-3 |
| Version: | 1.5-5 |
| Built: | 2026-06-25 17:14:24 UTC |
| Source: | https://codeberg.org/zeileis/fortunes |
Read and print R fortunes.
fortune(which = NULL, fortunes.data = NULL, fixed = TRUE, showMatches = FALSE, author = character(), ...) ## S3 method for class 'fortune' print(x, width = NULL, ...) read.fortunes(file = NULL)fortune(which = NULL, fortunes.data = NULL, fixed = TRUE, showMatches = FALSE, author = character(), ...) ## S3 method for class 'fortune' print(x, width = NULL, ...) read.fortunes(file = NULL)
which |
an integer specifying the row number of |
fortunes.data |
data frame containing a fortune in each row. By default the fortune data from the fortunes package are used. |
fixed |
logical passed to |
showMatches |
if |
author |
a |
... |
potential further arguments passed to |
x |
an object of class |
width |
integer specifying the character width. By default
|
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. |
fortune() returns an object of class "fortune" which is
a row from a data frame of fortunes (like those read in from read.fortunes).
read.fortunes() 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 |
source |
where it was quoted (if available, otherwise |
date |
when it was quoted (if available, otherwise |
fortune() # a random one fortune("Ripley") # a random one from those with 'Ripley' fortune(author = "Ripley") # a random one from those by 'Ripley' fortune(17) fortune("parse", showMatches = TRUE) # -> shows at least 5 matches fortune("parse.*answer") # nothing found but... fortune("parse.*answer", fixed = FALSE) # ...this works ## The first three "all together" ('setNames()' requires at least R 3.0.0): lapply(setNames(, c(38, 106, 129)), fortune)fortune() # a random one fortune("Ripley") # a random one from those with 'Ripley' fortune(author = "Ripley") # a random one from those by 'Ripley' fortune(17) fortune("parse", showMatches = TRUE) # -> shows at least 5 matches fortune("parse.*answer") # nothing found but... fortune("parse.*answer", fixed = FALSE) # ...this works ## The first three "all together" ('setNames()' requires at least R 3.0.0): lapply(setNames(, c(38, 106, 129)), fortune)