This post is inspired by The Art of Pi by Nadieh Bremer. The code is almost unabashedly wholesale taken from her github repo for the project.
##Get the data:
First read the happiness rankings of words in.
Convert A story into a vector of its individual words.
This story is the New York Times article: Sued Over Old Debt, and
Blocked From Suing Back
The stories text is loaded in a hidden block as the variable story
for space issues.
Convert the vector of the words into their respective happiness rankings.
Line Chart Style:
Combine these values into a dataframe and plot a simple line chart of the happiness trends.
Now convert the values into a random walk style coordinates.
Add these new values to the dataframe made earlier.
#Random Walk Style:
Plot the random walk style chart.