Description Usage Arguments Value Examples
Read and print R fortunes.
1 2 3 4 5 |
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 |
1 2 3 4 5 6 7 8 9 10 11 12 | 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)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.