Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What are fortunes?

Tags:

In R, one sometime sees people making references to fortunes. For example:

fortune(108) 

What does this mean? Where does this originate? Where can I get the code?

Edit. The sharp-eyed reader would have noticed that this question marks the 5,000th question with the [r] tag. Forgive the frivolity, but such a milestone should be marked with a bit of humour. For an extra bit of fun, you can provide an answer with your favourite fortune cookie.

like image 859
Andrie Avatar asked Jun 15 '11 14:06

Andrie


People also ask

What fortune means?

1 : a large sum of money. 2 : what happens to a person : good or bad luck. 3 : what is to happen to someone in the future I had my fortune told. 4 : wealth sense 1 They are a family of great fortune.

What is an example of fortune?

The definition of fortune is wealth, good luck or what is going to happen. An example of fortune is what someone had after inheriting millions of dollars. An example of fortune is the luck of having oil discovered on an otherwise useless piece of your land. An example of fortune is your destiny.

What are personal fortunes?

countable noun. You can refer to a large sum of money as a fortune or a small fortune to emphasize how large it is. [...] [emphasis]

What does make a fortune mean?

Earn a great deal of money, as in He made a fortune on the stock market. Similar expressions are be worth a fortune or small fortune, as in Now that their parents have died, they're worth a small fortune. Make a fortune dates from about 1700, and its use with small from the second half of the 1800s.


1 Answers

It refers to the fortunes package, which is a package that contains a whole set of humorous quotes and comments from the help lists, conferences, fora and even StackOverflow.

It is actually a database or small dataframe you can browse through.

library(fortunes) fortune() 

To get a random one. Or look for a specific one, eg :

> fortune("stackoverflow")  datayoda: Bing is my friend...I found the cumsum() function. Dirk Eddelbuettel: If bing is your friend, then rseek.org is bound  to be your uncle.    -- datayoda and Dirk Eddelbuettel (after searching for a function that        computes cumulative sums)       stackoverflow.com (October 2010) 

If you want to get all of them in a dataframe, just do

MyFortunes <- read.fortunes() 

The numbers sometimes referred to, are the row numbers of this dataframe. To find everything on stackoverflow :

> grep("(?i)stackoverflow",MyFortunes$source) [1] 273 275 > fortune(275)  I used a heuristic... pulled from my posterior. That makes it Bayesian, right?    -- JD Long (in a not too serious chat about modeling strategies)       Stackoverflow (November 2010) 
like image 133
Joris Meys Avatar answered Sep 23 '22 03:09

Joris Meys