Custom feed aggregator with rvest, Selectorgadget part 1

In this post I will begin a series project, starting with a goal and barebones implementation. In each issue of this series I will improve upon the previous version in : appearance, functionality, efficiency/readability of code, and hopefully some other ways.

Goal

In R, create a script that will: 

  •     pull recent posts from feeds I am interested in
  •     arrange these posts in easy to read hyperlinks using Rmarkdown

How will this be accomplished

Using rmarkdown, and rvest.

Selectorgadget has been integral to this project. If you are following along, be sure to digest Hadley Wickham’s excellent linked tutorial.

Some code and some words

We start by calling necessary packages.

library(rvest)

Next, define some cleaning functions. This is an area ripe for abstraction

cleanFun <- function(htmlString) {
 return(gsub("&lt;.*?&gt;", "", htmlString))
}
 
dearxiv <- function(htmlString) {
 return(gsub("arXiv:", "", htmlString))
}

Below define a function to pull and process data from arXiv.

get_arxiv <- function(source_html){
 html <- read_html(source_html)
 sg_articletitles <- '.list-title'
 AI_titles <- html_nodes(html, sg_articletitles)
 sg_arxlink <- '.list-identifier a:nth-child(1) , dt:nth-child(5) a:nth-child(2)'
 AI_arxlink <- html_nodes(html, sg_arxlink)
 sg_pdf <- '.list-identifier a:nth-child(2)'
 AI_pdf <- html_nodes(html, sg_pdf)
 sg_abstract <- '.list-identifier a:nth-child(1)'
 AI_abstract <- html_nodes(html, sg_abstract)
 arx_AI_abs_numbers <- dearxiv(cleanFun(AI_abstract))
 titles_trimmed <- vector()
 for(el in html_text(AI_titles)){
 titles_trimmed <- c(titles_trimmed, substr(el, 9, nchar(el) - 1))
 }
 arxiv_contents <- vector() #generate rmd hyperlink tags
 for(index in 1:length(titles_trimmed)){
 arxiv_contents <- c(arxiv_contents, paste('[', titles_trimmed[index], '](',
 'http://arxiv.org/abs/', arx_AI_abs_numbers[index], ')', sep = ''))
 }
 arxiv_contents
}

To start, we will only be pulling the 5 most recent articles from arXiv’s Artificial Intelligence, and Machine Learning streams. round_up serves the purpose to fetch these data, and write them to an rmarkdown file. I’m working in RStudio and utilize the function write_Rmd.

round_up <- function(){
 
 #read html here
 arxiv_AI <- get_arxiv("http://arxiv.org/list/cs.AI/pastweek?skip=0&amp;show=5")
 arxiv_ML <- get_arxiv('http://arxiv.org/list/stat.ML/pastweek?skip=0&amp;show=5')
 
 write_Rmd(file_name = 'arxAI.Rmd', contents = paste(c('# arxiv AI - new', arxiv_AI, 
 '# arxiv ML - new', arxiv_ML), sep = '\n'))
}

And then, we define the function to write our .Rmd

write_Rmd <- function(author = 'Ben Young', date = 'October 2, 1988', 
 title = 'feed test', output_type = 'html_document',
 file_name = 'test beta.Rmd', contents){
 yaml <- c('---',
 'title: "aggregate project 0.01"',
 'author: "Ben Young"',
 'date: "October 2, 1988"', # when Donnie Darko woke up on the golf course
 'output: html_document',
 '---')
 write(c(yaml, paste(contents, '\n')), file_name)
}

we compile, and run

round_up()

. Next we load the .Rmd in Rstudio, and knit it to html. The result looks like:

aggregator project 0.01 rendered Rmd

I’m very happy with this result!

Some thoughts

  •     there’s a bit left to clean up in the code developed here
  •     the functions are too specific for the most part
  •     the rendered html could look a lot better

Goals moving forward

  •     add the knitting process to our script so manual control is not necessary to generate the desired html
  •     add more feeds : stackOverflow – unanswered R, some news sites. and more
  •     make the script run as a cron job, posting to a page I can point to, updating every 5 minutes so I can just load my feed page and be up-to-date
  •     github repo (I currently have one but want to develop this project a bit further before focusing on it).
  •     address thoughts above

If you have thoughts

  •     comment here
  •     tweet me @bitbottestbot

EARL 2015: Boston write-up

A week ago I flew to Boston, Massachusetts for EARL 2015. This was my first business trip, and as such I was very excited. The conference, speakers, and attendees did not disappoint. Mango Solutions put on a great schedule of workshops and talks. I would recommend attending future EARLs to anyone using R professionally.

Below is a summary of my time at EARL 2015.

Day 0
Workshops

Introduction to Rcpp
Dirk Eddelbuettel
Dirk gave a great introduction to Rcpp from the ground up. I am a novice C++ developer, and I was able to follow along from start to finish. I feel inspired to start working with Rcpp myself. Two ideas are (a) write a package facilitating connection with MIDI devices, to enable producing music from R, and (b) a fast poker evaluator based on a fast C++ evaluator.

Interactive Reporting with RMarkdown and Shiny
Garrett Grolemund
I taught myself Shiny about a year ago. Several months ago I started experimenting with RMarkdown. Garrett gave an enlightening, in-depth workshop on how to combine the two, with a result that is highly efficient and consistent.

Day 1
Talks

Monday morning I walked from my bed and (not) breakfast about a mile from the NERD center. Cambridge is beautiful, I highly recommend exploring.

R in Market Research – Handling ‘Wide'(not big) Data
Shad Thomas – Glass Box Research
A good approach at answering the question “how do you smartly reduce the amount of data without losing meaning?”

Heuristic Methods for Real World Optimization
Brandon Bass – Altenex LLC
Brandon’s talk has me interested in learning more about (a) Particle Swarm Optimization and (b) Evolutionary Algorithms. There was a funny, very meta moment when Brandon binged and googled ‘What is optimization?’. Being in a Microsoft building, it seemed fitting that Bing gave an excellent answer, and Google’s was off base.

How to do Survival Analysis of Health Data in R
Monika Wahi – DethWench Professional Services
I particularly appreciated Monika’s talk, as I do Survival Analysis as part of my work from time to time. Monika’s quote “I prefer logisitic regression, someone’s either dead or alive, and that’s pretty clear, linear regression is kind of waffley.” Her talk highlighted three approaches to survival analysis – parametric, semi parametric, and non parametric. In Monika’s line of work, semi parametric models are frequently used, specifically Cox model. The non parametric Kaplan Meier is also frequently used.

Predictive Models for Neglected Disease Drug Discovery
Paul Kowalczyk – Syngenta Biotechnology
Paul’s background is in drug design. He led an engaged discussion using Shiny. Paul illustrated techniques in drug development using machine learning techniques such as random forest, SVM, and KNN. I especially appreciated Paul focusing on literate programming – being sure someone can run your code without you in the room, big things don’t need to be explained.

Visualizing Models
Jared Lander – Lander Analytics
Jared generated some beautiful, enlightenting graphics. My favorite was the visualization of elastic nets with coefficient paths.

Visualization and Sensitivity Analysis of PK/PD Models in R
Yan Li – Celgene
Yan Li gave a compelling talk advocating for a paradigm shift to model based drug development. The methods usually followed now cost billions of dollars from start to finish for a drug. Yan broke down the processes of drug development, addressing issues, innovative solutions, and more.

Sharing Data between R and non R users
Aimee Gott – Mango Solutions
Aimee’s talk was my favorite of the conference. She talked at length about a solution Mango developed, their client wanted their R users to be able to seamlessly collaborate with their Excel users. She also gave a visual tour of how this solution manifested. Overall a very impressive application.

Customizing R Machine Learning to Your Problem with Caret
Marcos Pereira – Millward Brown
Marcos covered the caret package, customizing the summary function, and customizing the caret models. A great exploration of the package.

Creating Rich Analytic Presentations with the RCloud Framework
– Doug Ashton – Mango Solutions
Doug demoed RCloud, a product compared to ipython notebook. To me it looks like the perfect toolbox for implementing finely tuned scripts. I’m currently trying to get RCloud running on a remote machine, though admittedly the process is quite difficult.

Day 2
Talks continued

Opening Keynote 1
Richard Pugh – Mango Solutions
Richard gave an inspiring keynote, my favorite note of which is that going out and hiring “unicorns” is not reasonable. Richard showed tools that had been made to assist in scoring employees and prospective hirees, and how he used these tools to “build a unicorn.”

Opening Keynote 2
Garrett Grolemund – RStudio
Garrett’s keynote was very interesting. He talked about how his career began as a psychologist, moving on speaking about how the brain processes information, that everything we perceive is inherently flawed. He made a lot of well-placed references to The Matrix. My biggest take away was that a data scientist’s job is to determine what the truth about reality is.

Measuring Brand Ad Effectiveness
Tim Hesterberg – Google
Tim gave a history of consumer surveys, as well as how Google collects, filters, and fits data from their surveys today. Tim kept his talk fresh and interesting by giving a narrative from the side of the sales department, as well as the side of the survey taker.

Performance Attribution for Equity Portfolios
Yang Lu – Hutchin Hill Capital
I spoke with Yang before his talk. He told me he’s been using R since college, that his workplace is very R friendly, and his bosses love R. His talk addresed the question “how do we measure portfolio performance?” Yang’s answer utilized a Brinson model, as well as a regression based approach.

Using R and Bioconductor in Cancer Genetics and Precision Medicine
Aedin Culhane – Dana-Farber Cancer Institute and Harvard TH Chan School of Public Health
Aedin opened her talk by recalling the Horse Manure Crisis of 1894, as an example of shortsighted modeling. Many were panicking about the growing amounts of horse manure, with no end in sight, and the advent of the automobile stopped this problem. Following, Aedin’s talk explored personalized medicine, and genome sequencing (of which R plays a large role, in the Bioconductor libary).

Quantitative Portfolio Management with High Frequency Data
Jerzy Pawlowski – NYU Polytechnic School of Engineering

Jerzy was kind enough to comment below with a great description and some links (quote in italics)

In a nutshell, my thesis were the following:
1. Most market research is based on daily data.
2. Very little research has been devoted to investor risk and return preferences for higher moments, like skew and kurtosis.
3. High frequency data can provide more accurate estimators of higher moments.
4. Using R for performing research using intraday (high frequency) data requires fast vectorized functions, because of the data size.
5. My presentation provides data and R code for users to explore some simple trading strategies that use high frequency data.
Jerzy’s Presentation
HighFreq GitHub repository

Garbage In, Garbage Out – Automating Data Quality
Rob Weyrauch
Rob described how EarlyWarning was created, for detecting fraud in banks, and wholly owned by 5 major banks.

A declarative DSL for the plotly graphing library in R
Jack Parmer – Plotly
Plotly has recently released their javascript code. Jack showed that plotly can be used in Shiny apps, and showed that plotly graphs can be easily edited, convenient and usable for non-r people.

Deploying predictive models as APIs
Sean Lorenz – Domino Data Labs
Sean demoed his company’s product, which allows predictive models to be called via API. This product is not only cloud-based, but also available as an on-premise release.

Predicting Student Success at Scale: APIs and DSLs for Building and Integrating Many Models
Harlan Harris – Educational Advisory Board
Harlan talked about his company, and some principles that ring true : “the data science team does the data science”, and “use tools that you know to build tools that you’ll use”.

Scaling R for Real-world Business Analytics
Roger Fried – Teradata
Roger gave a demo of Teradata’s AsterR, highlighting it’s abilities to easily perform glm-like operations on billions of rows.

EARL 2015 : Boston was a fantastic time, and I learned a lot. I’m motivated to put this new knowledge to work, and plan to post more, interesting posts very soon.

hey look! some pictures!

Partial Suspension of Disbelief : Really Fast Food

For the purposes of this post, a partial suspension of disbelief will be an exploration into a fantastical subject usually exempted from analytic consideration. If you have ideas for further topics, let me know!

In the world of superheroes, Daphne Millbrook is known as a =”_blank”>speedster. She’s not just fast, she’s really fast.

Daphne-Millbrook-S03E03-daphne-millbrook-2440105-1600-2400

In season 3 of the original series, Daphne steals a valuable artifact from the show’s namesake, Hiro Nakamura. After a brief altercation involving Hiro’s time-traveling ability, she escapes Yamagato Industries headquarters in Tokyo, Japan, arriving back at her lofty apartment in Paris, France in hardly any time at all.


14 Rue des Fossés Saint-Jacques Paris, France in the subtitles

Suspending some disbelief regarding whether or not Daphne could run over water, and ignoring difficult terrain, this journey would take about 6,045 miles ‘as the crow flies’.

A few months ago I lost my way in Denver and ended up walking about 8 miles to get home. I was famished. When Daphne runs more than 750 times that length, I wonder, how much does she need to eat?

I like quesaritos
I like quesaritos. I made this in GIMP (www.gimp.org)

To answer this question, I will begin by referencing the USDA, as well as assuming that Daphne burns calories as a 154-pound man would (if you can point me to some scholarly articles about calories burned and how to adjust by BMI and other factors, let me know!).

5 miles would burn 590 calories.

With these assumptions, Daphne is going to have to account for 713,310 calories. That’s a lot of quesaritos! (1,097.4 if she gets the standard from T-bell. I get a modified version, vegetarian, not sure how many calories are in that.)

I wrote an R script to scrape the calorie data I needed to make a Shiny/R app that randomly generates an order for Daphne. At the bottom of the post, the source files to build and generate on your own. If I can successfully debug why it won’t work deployed on my site, I’ll embed it at the top of this post.

(Click to see a Dominos Order —->)

Daphne Millbrook ran 6,045 miles. To account for burning 713,310 calories, she ate a substantial amount of food from Dominos. Her order was as follows : 88x Barbeque Buffalo Wings, 98x Blue Cheese Dressing, 92x Beef, 84x American Cheese, 86x Ultimate Deep Dish, 103x Hand-Tossed & Thin Crust Cheese, 88x Hand-Tossed & Thin Crust Cheese, 93x Garden Fresh Salad, 97x Pepperoni, 83x Philly Cheese Steak, 75x Domino’s Pizza Chicken Kickers, 83x Vegi Feast, 72x Deluxe Feast, 94x Ham, 92x Sausage, 94x Ripe (Black) Olives, 90x Crunchy Thin Crust, 89x ExtravaganZZa, 81x America’s Favorite, 92x Green Olives, 106x Buttermilk Ranch Dressing, 93x Green Olives, 77x Bacon Cheeseburger, 78x Grilled Chicken, 91x Deluxe Feast, 82x Pineapple, 98x Bacon Cheeseburger, 88x Extra Cheese, 78x Deep Dish Cheese, 102x Hawaiian Feast, 94x Pizza Sauce, 90x Hot Buffalo Wings, 88x Grilled Chicken, 82x Deep Dish Cheese, 76x Ranch Dipping Sauce, 91x Blue Cheese Dipping Sauce, 79x Grilled Chicken Caesar, 87x Pepperoni Feast, 100x Brownie Squares, 80x Barbecue Feast, 82x Marinara Dipping Sauce, 89x American Cheese, 84x Philly Steak, 80x Philly Cheese Steak, 83x Sausage, 87x Crunchy Thin Crust, 87x Sweet Icing Dipping Sauce, 81x Golden Italian Dressing, 91x Bacon, 88x ExtravaganZZa, 76x Light Italian Dressing, 85x MeatZZa Feast, 68x Garlic Dipping Sauce, 82x Cheddar Cheese, 90x Bacon, 83x Provolone Cheese, 90x Extra Cheese, 75x Hawaiian Feast, 79x Pineapple, 114x Cinna Stix, 98x Classic Hand-Tossed, 72x America’s Favorite, 93x Cheddar Cheese, 101x Ultimate Deep Dish, 80x Ripe (Black) Olives, 70x Creamy Caesar Dressing, 98x Breadsticks, 97x Ham, 96x Garlic, 92x Provolone Cheese, 86x Vegi Feast, 110x Pepperoni Feast, 84x Beef, 92x Hot Dipping Sauce, 97x Pizza Sauce, 94x Philly Steak, 93x Barbecue Feast, 86x MeatZZa Feast, 90x Cheesy Bread, 85x Fudge Dipping Sauce, 82x Garlic, 96x Pepperoni, and a whole lot of water!

(Click to see an Olive Garden Order —->)

Daphne Millbrook ran 6,045 miles. To account for burning 713,310 calories, she ate a substantial amount of food from Olive Garden. Her order was as follows : 5x Create Your Own Pizza with cheese and sauce only, 8x Spicy Shrimp Scampi Fritta Sandwich (Whole), 10x Wild Berry Frozen Margarita, 5x Chicken Fingers & Pasta, 7x Chocolate Mousse Cake, 5x Chocolate Sauce, 9x Peach Daiquiri, 10x Strawberry & White Chocolate, 10x Crispy Parmesan Shrimp (dinner portion), 6x Raspberry Lemonade, 4x Spaghetti with Meat Sauce (lunch portion), 10x Breadstick with garlic-butter spread, 6x Tomato Sauce, 3x White Chocolate Raspberry Cheesecake, 4x Parmesan Crusted Tilapia (dinner portion), 4x Cavatappi, 9x Linguine alla Marinara (lunch portion), 3x Fried Mozzarella (Create a Sampler portion), 6x Regular Draft 14 oz, 6x Fettuccine Alfredo (dinner portion), 7x Strawberry Passion Fruit Limonata, 2x Shrimp Scampi Fritta Sandwich (Whole), 4x Parmesan-Butter Sauce, 5x Garden-Fresh Salad (one serving without dressing), 5x Wilberry Smoothie, 8x Alfredo Sauce, 8x Wild Berry Daiquiri, 3x Cranberry Juice, 8x Seafood Alfredo (dinner portion), 4x Cheese Ravioli with Meat Sauce (dinner portion), 5x Steamed Broccoli, 8x Chicken Alfredo (dinner portion), 7x Seafood Brodetto (dinner portion), 7x Spaghetti & Meatballs (lunch portion), 5x Dr Pepper©, 7x Chicken Meatballs, 8x Smoked Mozzarella Fonduta, 6x Coca-Cola©, 4x Spaghetti, 8x Marinara Sauce, 11x Grilled Chicken Spiedini with Creamy Alfredo with Tomatoes, 8x Tour of Italy (lunch and dinner portion), 7x Chicken Parmigiana (lunch portion), 11x Seafood Alfredo (lunch portion), 1x Grilled Chicken Caesar Salad, 7x Minestrone, 8x Zeppoli, 7x Calamari (appetizer portion), 7x Chicken Scampi (lunch portion), 6x Cranberry Juice, 7x Eggplant Parmigiana (dinner portion), 6x Peach Sangria Glass, 8x Alfredo, 9x Pumpkin Cheesecake, 5x Venetian Sunset, 5x Cappuccino with Whipped Cream, 9x Raspberry Lemonade, 5x Wild Berry Frullato Smoothie, 6x Italian Margarita, 7x Mussels di Napoli, 9x Orange Juice, 6x Sparkling Glass, 4x Strawberry Smoothie, 9x Strawberry Frullato Smoothie, 12x Strawberry Frozen Margarita, 10x Five Cheese Ziti al Forno (dinner portion), 2x Marinara Sauce, 6x Stuffed Mushrooms (Create a Sampler and Appetizer portion), 5x Marinara Sauce, 4x Light Bottle, 7x Parmesan-Peppercorn Sauce, 7x Zuppa Toscana, 4x Capellini Pomodoro (lunch portion), 6x Red, White, Blush Glass, 9x Strawberry Fresco Cocktail, 8x Regular Draft 20 oz, 3x Shrimp Scampi Fritta Sandwich (Half), 6x Add Chicken Fritta, 2x Moscato Aperol Cocktail, 7x Italian Meatball Sandwich (Whole), 10x Grilled Chicken Flatbread, 3x Bellini Peach-Raspberry Iced Tea, 6x Chicken & Gnocchi, 6x Roscato Berry Cocktail, 3x Chicken Alfredo Pizza, 14x Strawberry Bellini, 7x Grilled Sausage & Peppers Rustica (dinner portion), 11x Add Grilled Shrimp, 10x Whole Wheat Linguine, 4x Crispy Chickpeas, 5x Add Black Olives, 3x Fried Zucchini (Create a Sampler portion), 7x Cheese Ravioli with Marinara Sauce (lunch portion), 11x Mango Martini, 5x Grilled Chicken Spiedini with Sweet Red Wine Sauce, 12x Shrimp Mezzaluna (dinner portion), 8x Penne, 5x Add Onions, 7x Braised Beef & Tortelloni (dinner portion), 7x Chocolate Mousse, 7x Non-alcoholic Bottle, 9x Add Meatball, 11x Add Italian Sausage, 6x Chicken Alfredo Calzone, 1x Skinny Margarita, 8x Shrimp Scampi Fritta, 3x Add Grilled Shrimp, 6x Cheese Pizza, 6x Regular Bottle, 8x Caffé Latte, 8x Limoncello Mousse, 11x Penne, 5x Moscato Peach Chicken (dinner portion), 8x Mixed Grill (dinner portion with Roasted Asparagus), 6x Lemon Cream Cake, 3x Strawberry-Mango Frozen Margarita, 13x Chicken Parmigiana Sandwich (Half), 8x Tour di Mare (dinner portion), 7x Toasted Beef & Pork Ravioli (Create a Sampler portion), 6x Strawberry-Limoncello Martini, 5x Add Grilled Chicken, 2x Steak Gorgonzola Alfredo (dinner portion), 8x Red, White, Blush Quartino, 11x Add Grilled Shrimp, 4x Spicy Shrimp Vesuvio (dinner portion), 2x Sicilian Citrus Margarita, 5x Eggplant Parmigiana (lunch portion), 7x Add Grilled Chicken, 8x Sprite©, 7x Grilled Pork Veneto (dinner portion), 4x Chicken Parmigiana (dinner portion), 8x Amaretto Tiramisu, 9x Five Cheese Marinara, 6x Braised Beef & Tortelloni (lunch portion), 8x Tour of Italy (lunch and dinner portion), 7x Add Meatballs, 8x Mixed Grill (dinner portion with Grilled Vegetables), 4x Small Shells, 6x Chicken Fingers (Create a Sampler portion), 5x Apple Juice, 10x Lobster Cannelloni with Shrimp (dinner portion), 5x Add Italian Sausage, 7x Ravioli di Portobello (lunch portion), 7x Skinny Strawberry Lemon Martini, 2x Spaghetti, 7x Venetian Apricot Chicken (dinner portion), 5x Spicy Shrimp Vesuvio (lunch portion), 5x Garden-Fresh Salad (one serving with dressing), 6x Add Grilled Chicken, 7x Italian Sodas, 8x Chicken Marsala (dinner portion), 4x Triple Chocolate Strata, 8x Pasta e Fagioli, 3x Venetian Apricot Chicken (lunch portion), 8x Watermelon Margarita, 14x Tiramisu, 11x Lasagna Classico (lunch portion), 9x Spaghetti & Italian Sausage (dinner portion), 6x Lasagna Classico (dinner portion), 6x Caprese Flatbread, 4x Sausage Pomodoro, 6x Add Bell Peppers, 7x Whole Wheat Linguine, 9x Pizza Fritta Napoli, 2x Spaghetti & Meatballs (dinner portion), 6x Meat Sauce, 6x Pizzaiola Calzone, 5x Sicilian Scampi, 6x Add Mushrooms, 7x 1% Low Fat Chocolate Milk, 6x Chicken & Shrimp Carbonara (dinner portion), 10x Spicy Shrimp Scampi Fritta Sandwich (Half), 7x Caffé Mocha, 7x Dark Chocolate Caramel Cream, 9x 1% Low Fat Milk, 3x Roasted Garlic Hummus, 7x Pineapple Juice, 7x Light Draft 20 oz, 6x Add Italian Sausage, 6x Mango Daiquiri, 10x Fettuccine Alfredo (lunch portion), 7x Italian Meatball Sandwich (Half), 7x Macaroni & Cheese, 7x Sausage & Peppers Sandwich (Whole), 5x Add Shrimp, 3x Parmesan Roasted Asparagus, 4x Peach Bellini, 4x Angel Hair, 12x Peach Sangria Pitcher, 6x Caramel Hazelnut Macchiato, 9x Grapes, 11x Spicy Shrimp Fritta, 2x Steak Toscano (dinner portion), 9x Black Tie Mousse Cake, 8x Parmesan Potato Chips, 6x Frozen Cappuccino, 3x Spaghetti & Italian Sausage (lunch portion), 6x Apple Juice, 7x Wild Berry Bellini, 6x Berry Sangria Glass, 7x Fanta Zero Orange©, 5x Cheese Ravioli with Marinara Sauce (dinner portion), 7x Tomato Sauce, 7x Capellini Pomodoro (dinner portion), 4x Strawberry Daiquiri, 5x Mashed Potatoes, 3x Stuffed Chicken Marsala (dinner portion), 3x Add Grilled Chicken, 8x Add Grilled Shrimp, 5x Peach-Mango Smoothie, 7x Minute Maid Limeade©, 5x Grilled Sausage & Peppers Rustica (lunch portion), 6x Sausage & Peppers Sandwich (Half), 3x Fettuccine, 7x Potato Porcini (Seasonal), 7x Red, White, Blush Bottle, 2x Add Pepperoni, 5x Crispy Risotto Bites (Arancini), 8x Cappuccino, 8x Herb-Grilled Salmon (dinner portion), 5x Asiago Garlic Alfredo, 7x Lasagna Fritta, 3x Shrimp Mezzaluna (lunch portion), 3x Alfredo Sauce, 5x Red, White, Blush Magnum, 5x Chicken Alfredo (lunch portion), 7x Chicken Parmigiana Sandwich (Whole), 7x Hot Artichoke-Spinach Dip, 8x Spicy Chicken Fritta, 7x Linguine, 1x Cheese Ravioli with Meat Sauce (lunch portion), 6x Five Cheese Marinara Sauce, 7x Cheese Ravioli, 6x Light Draft 14 oz, 5x Orange Juice, 6x Bruschetta, 7x Fettuccine, 4x Pepperoni Pizza, 4x Spaghetti with Meat Sauce (dinner portion), 7x Add Grilled Chicken, 8x Peach-Mango Smoothie, 4x Meat Sauce, 8x Chicken Scampi (dinner portion), 8x Blackberry Blood Orange Tea, 11x Sparkling Bottle, 10x Lasagna Primavera with Grilled Chicken (dinner portion), 8x Alfredo Sauce, 3x Add Roma Tomatoes, 4x Ravioli di Portobello (dinner portion), 9x Five Cheese Ziti al Forno (lunch portion), 6x Berry Sangria Pitcher, 5x Marinara, and a whole lot of water!

(Click to see a Taco Bell Order —->)

Daphne Millbrook ran 6,045 miles. To account for burning 713,310 calories, she ate a substantial amount of food from Taco Bell. Her order was as follows : 10x XXL Grilled Stuft Burrito – Steak, 11x Quesarito, 6x Mango BBQ Crispy Chicken Griller, 6x Side of Eggs, 13x Soft Taco Supreme® – Beef, 4x Dr Pepper 16 oz, 5x A.M. Grilled Taco – Egg and Cheese, 7x Mountain Dew Baja Blast 30 oz, 9x Grande Scrambler Burrito – Sausage, 16x Smothered Burrito – Steak, 8x Country Grilled Breakfast Burrito – Sausage, 11x 7-Layer Burrito, 11x Manzanita Sol® 20 oz, 11x Bean Burrito, 10x Chips and Pico De Gallo, 6x Spicy Tostada, 10x Black Beans and Rice, 8x Doritos® Cheesy Gordita Crunch – Cool Ranch, 8x Dr Pepper 30 oz, 9x Shredded Chicken Mini Quesadilla, 10x Chalupa Supreme® – Steak, 5x Chalupa Supreme® – Beef, 11x Smothered Burrito – Beef, 6x MexiMelt®, 8x Pepsi 20 oz, 10x Mango BBQ Chickstar, 5x Cinnabon® Delights™ Coffee – Iced, 12x A.M. Crunchwrap® – Steak, 6x Guacamole, 9x Cheese Roll-Up, 9x Grilled Breakfast Burrito – Fiesta Potato, 9x A.M. Grilled Taco – Sausage, 7x Fiesta Taco Salad-Beef, 11x Doritos® Cheesy Gordita Crunch – Nacho Cheese, 11x Cantina Power Burrito – Steak, 5x Sierra Mist 40 oz, 7x Tropicana Pink Lemonade 40 oz, 10x Cantina Power Bowl – Veggie, 9x Sierra Mist 20 oz, 10x Burrito Supreme® – Chicken, 6x MUG Root Beer 20 oz, 10x Cheese Roll-Up, 7x BLT Crunchwrap Slider, 11x Spicy Potato Soft Taco, 14x Beefy Cheddar Crunchwrap Slider, 11x Mtn Dew® Sangria Blast 40 oz, 7x Pico de Gallo, 6x Cool Ranch® Doritos® Locos Taco, 11x Nacho Cheese Doritos® Locos Taco, 10x Pepsi 16 oz, 11x Cinnabon® Delights™ 4 Pack, 6x Triple Layer Nachos, 12x Mountain Dew Kickstart Orange Citrus 16 oz, 10x Double Decker® Taco, 9x Fresco Chicken Soft Taco, 13x Brisk® Mango Fiesta 40 oz, 8x Manzanita Sol® 40 oz, 16x Bacon, Egg & Cheese Biscuit Taco, 8x Nacho Cheese Doritos® Locos Taco Supreme, 10x Cheesy Fiesta Potatoes, 3x Mtn Dew® Baja Blast Freeze 16 oz, 15x Fresco Crunchy Taco, 10x Salsa Verde, 7x Bacon Ranch Chickstar, 7x Doritos® Cheesy Gordita Crunch – Cool Ranch, 11x California A.M. Crunchwrap, 9x Cantina Power Burrito – Chicken, 6x MUG Root Beer 30 oz, 6x Snapple Lemonade Freeze, 7x Salsa Dip, 17x Reduced Fat Sour Cream, 4x Cheesy Bean and Rice Burrito, 9x Fiesta Taco Salad-Chicken, 7x Tropicana Pink Lemonade 30 oz, 11x Fresco Grilled Steak Soft Taco, 7x Mountain Dew 16 oz, 3x Burrito Supreme® – Beef, 10x Country AM Crunchwrap – Sausage, 9x Premium Guacamole Dip, 8x Mountain Dew Kickstart Orange Citrus 30 oz, 13x Tropicana® Orange Juice, 8x Crunchy Taco Supreme®, 14x Cheese Quesadilla, 7x Mtn Dew® Sangria Blast 30 oz, 12x Gordita Supreme® – Beef, 13x Premium Iced Coffee, 7x Double Tostada, 5x Creamy Jalapeno Sauce, 4x Brisk® Iced Tea and Lemonade 20 oz, 8x Cheesy Burrito – Bacon – Fresco Style, 2x Chicken Biscuit Taco with Gravy, 8x MUG Root Beer 40 oz, 7x Mountain Dew Kickstart Orange Citrus 30 oz, 6x Black Beans, 10x Burrito Supreme® – Steak, 9x Quesarito, 9x Mountain Dew Kickstart Orange Citrus 40 oz, 10x Nachos Supreme, 9x Loaded Potato Griller, 10x Chicken Burrito, 8x Cantina Power Burrito – Veggie, 7x Cinnabon® Delights™ Coffee, 11x Mexican Pizza, 7x Express Taco Salad w/ Chips, 10x Cheesy Burrito – Steak and Egg, 10x Doritos® Cheesy Gordita Crunch – Nacho Cheese, 6x Fiery Doritos® Locos Taco, 9x Cool Ranch® Doritos® Locos Taco Supreme, 12x Cinnabon® Delights™ 2 Pack, 10x Brisk® Mango Fiesta 20 oz, 9x Spicy Tostada, 10x Chili Cheese Burrito, 12x Cheesy Burrito – Bacon, 9x Fresco Crunchy Taco, 7x Caramel Apple Empanada, 5x Cinnamon Twists, 6x Pepsi 30 oz, 6x Fresco Burrito Supreme® – Steak, 11x Grande Scrambler Burrito – Bacon, 15x Nacho Cheese Dip, 14x Cheesy Bean and Rice Burrito, 7x Chili Cheese Fries Loaded Griller, 5x Cheesy Gordita Crunch, 5x Chips and Guacamole, 6x Smothered Burrito – Shredded Chicken, 6x Fresco Burrito Supreme® – Chicken, 4x Beefy Mini Quesadilla, 14x Chicken Soft Taco, 8x Cheesy Potato Burrito, 5x A.M. Crunchwrap® – Sausage, 9x Dr Pepper 20 oz, 5x Cantina Power Bowl – Chicken, 5x Tropicana® Orange Juice, 10x Mountain Dew Baja Blast 16 oz, 11x Mountain Dew Kickstart Orange Citrus 40 oz, 7x Tropicana Pink Lemonade 20 oz, 8x Fresco Soft Taco, 7x Starburst Strawberry Freeze 16oz, 8x Dr Pepper 40 oz, 9x Combo Burrito, 3x Jalapeno Honey Crispy Chicken Griller, 6x Mountain Dew Kickstart Orange Citrus, 6x Fiery Doritos® Locos Taco Supreme, 8x Brisk® Iced Tea and Lemonade 40 oz, 7x Spicy Potato Soft Taco, 7x Doritos® Cheesy Gordita Crunch – Fiery, 9x Green Tomatillo Sauce, 7x Express Taco Salad w/ Chips, 15x Grilled Steak Soft Taco, 8x Pizza Sauce, 14x Cinnabon® Delights™ 12 Pack, 7x Double Crispy Chicken Quesadilla, 7x Mtn Dew® Sangria Blast 16 oz, 6x Grande Scrambler Burrito – Steak, 10x Mtn Dew® Sangria Blast 20 oz, 14x Spicy Chicken Cool Ranch® DLT Supreme, 8x Crunchwrap Supreme®, 7x Cinnabon® Delights™ 2 Pack, 4x Mountain Dew 20 oz, 9x Grilled Breakfast Burrito – Sausage, 11x Starburst Strawberry Freeze, 15x Cantina Power Bowl – Steak, 7x A.M. Grilled Taco – Bacon, 9x Cinnabon® Delights™ Coffee, 9x Avocado Ranch Dressing, 11x Salsa, 7x Sausage, Egg and Cheese Biscuit Taco, 9x Cinnabon® Delights™ 4 Pack, 10x Triple Layer Nachos, 9x Spicy Chicken Crunchwrap Slider, 6x Cinnabon® Delights™ Coffee – Iced, 10x Mountain Dew Baja Blast 20 oz, 6x Fresco Chicken Soft Taco, 8x Cheesy Burrito – Steak and Egg – Fresco Style, 7x Spicy Ranch Crispy Chicken Griller, 3x Chicken Biscuit Taco with Jalapeno Honey, 8x Premium Coffee, 5x Fiesta Taco Salad-Steak, 13x Nachos, 10x Chili Cheese Burrito, 12x Mountain Dew Baja Blast 40 oz, 4x Doritos® Cheesy Gordita Crunch – Fiery, 12x Mtn Dew Baja Blast Freeze, 10x Sierra Mist 30 oz, 13x MUG Root Beer 16 oz, 8x Shredded Chicken Mini Quesadilla, 7x Brisk® Iced Tea and Lemonade 30 oz, 7x Premium Hot Coffee with creamer, 11x Chipotle Crispy Chicken Griller, 13x DOUBLE DECKER® Taco Supreme®, 11x Manzanita Sol® 30 oz, 7x Beefy 5-Layer Burrito, 12x A.M. Crunchwrap® – Bacon, 13x Beefy Nacho Griller, 9x Caramel Apple Empanada, 13x Spicy Ranch Dip, 5x Crunchy Taco, 5x Beefy Mini Quesadilla, 16x Smothered Burrito – Shredded Chicken, 6x XXL Grilled Stuft Burrito – Chicken, 8x Brisk® Iced Tea and Lemonade 16 oz, 9x Reduced-Fat Sour Cream Dip, 8x Beefy Fritos® Burrito, 6x Chipotle Chickstar, 7x Brisk® Mango Fiesta 16 oz, 8x Tropicana Pink Lemonade 16 oz, 6x Smothered Burrito – Beef, 8x A.M. Crunchwrap® – Bacon, 6x Soft Taco-Beef, 9x XXL Grilled Stuft Burrito – Beef, 6x Steak Quesadilla, 6x Egg and Cheese Biscuit Taco, 6x Sierra Mist 16 oz, 7x Mountain Dew Kickstart Orange Citrus 16 oz, 5x Pintos n Cheese, 9x A.M. Crunchwrap® – Steak, 11x Cheesy Burrito – Sausage, 9x Mountain Dew 40 oz, 6x Chipotle Chicken Loaded Griller, 7x Black Bean Burrito, 6x Snapple Lemonade Freeze 16oz, 2x Sausage and Cheese Biscuit Taco, 11x Brisk® Mango Fiesta 30 oz, 11x Pepsi 40 oz, 7x Premium Hot Coffee with creamer, 4x Chalupa Supreme® – Chicken, 9x Cinnabon® Delights™ 2 Pack, 7x Gordita Supreme® – Steak, 11x Premium Coffee, 8x Cheesy Burrito – Sausage – Fresco Style, 11x Red Sauce, 6x Mountain Dew Kickstart Orange Citrus, 9x Hash Brown, 4x Cheesy Burrito – Steak and Egg, 13x Chicken Quesadilla, 11x Grilled Breakfast Burrito – Bacon, 8x Nachos BellGrande®, 4x Manzanita Sol® 16 oz, 7x Premium Iced Coffee, 13x Gordita Supreme® – Chicken, 8x A.M. Crunchwrap® – Sausage, 6x Mountain Dew 30 oz, 15x Premium Latin Rice, 9x Cinnamon Twists, 8x Smothered Burrito – Steak, and a whole lot of water!

(Click to see a Burger King Order —->)

Daphne Millbrook ran 6,045 miles. To account for burning 713,310 calories, she ate a substantial amount of food from Burger King. Her order was as follows : 13x Chicken Crisp Sandwich- classic, 17x Wisconsin White Cheddar Whopper JR., 10x Home-style Chicken Strips- 3pc, 7x Wisconsin White Cheddar Whopper, 9x HERSHEY®’S Sundae Pie, 12x Premium Alaskan Fish Sandwich, 13x WHOPPER JR.® Sandwich with Cheese, 9x Seattle’s Best Coffee® Iced Coffee – MED- CARAMEL, 7x Double Hamburger, 11x Onion Rings – small, 21x Strawberry Milk Shake 20 fl oz, 14x Chocolate Milk Shake 20 fl oz, 12x Chicken BLT Garden Fresh Salad Wrap- crispy, 5x Brownie Sundae, 6x French Fries – medium (Salted), 6x Smoothie: Strawberry Banana 16 fl oz, 13x Premium Alaskan Fish Sandwich w/o Tartar Sauce, 10x Country Ham and Egg Biscuit, 11x Home-style Chicken Strips- 2pc, 10x Chicken Apple & Cranberry Garden Fresh Salad with TENDERGRILL and dressing, 9x Strawberry Milk Shake 16 fl oz, 13x Sausage Biscuit, 11x Seattle’s Best Coffee® Iced Coffee -LARGE- VANILLA, 11x Caramel Frappe: 16 fl oz, 9x CROISSAN’WICH® Sausage, Egg & Cheese, 12x Caramel Frappe: 20 fl oz, 13x Tacos (2), 5x Honey Mustard Grilled Chicken Wrap, 12x Vanilla Milk Shake 20 fl oz, 8x DOUBLE WHOPPER® Sandwich, 5x Chicken Apple and Cranberry Garden Fresh Salad Wrap- crispy, 13x Quaker® Oatmeal Maple and Brown Sugar Flavor*, 11x Side Garden Salad and Avocado Ranch Dressing, 9x Quaker® Oatmeal Original, 13x Seattle’s Best Coffee® Iced Coffee – MED-VANILLA, 12x White Chocolate Macadamia Nut Cookies (2), 10x Seattle’s Best Coffee® Iced Coffee -LARGE- MOCHA, 10x Mocha Frappe: 16 fl oz, 9x Ham, Egg, & Cheese Biscuit, 14x TRIPLE WHOPPER® Sandwich w/o Mayo, 10x Vanilla Milk Shake 12 fl oz, 13x Chicken Crisp Sandwich- Spicy, 11x BK®Breakfast Muffin Sandwich Sausage, egg and Cheese, 9x Chocolate Milk Shake 16 fl oz, 6x Seattle’s Best Coffee® Iced Coffee – MED- MOCHA, 10x Chicken Nuggets (20 pc), 10x Honey Mustard Crispy Chicken Wrap, 11x Mocha Frappe: 12 fl oz, 11x Kids Oatmeal, 10x French Toast Sticks (5 piece), 11x CROISSAN’WICH® Ham, Egg & Cheese, 13x French Fries – value (Salted), 15x French Fries – small (Salted), 15x Smoothie: Strawberry Banana 20 fl oz, 14x Home-style Caesar Croutons- Packet, 11x Sweet Potato Curly Fries (M), 11x Ken’s Honey Mustard Dressing- packet, 10x WHOPPER JR.® Sandwich with Cheese w/o Mayo, 10x French Toast Sticks (3 piece), 13x Cheeseburger, 16x BK VEGGIE® Burger w/ Cheese, 14x Original Chicken Sandwich w/o Mayo, 6x Seattle’s Best Coffee® Iced Coffee -LARGE- CARAMEL, 3x DOUBLE WHOPPER® Sandwich with Cheese, 9x BK®Breakfast Muffin Sandwich Egg and Cheese, 7x DOUBLE CROISSAN’WICH™ w/ Ham, Bacon, Egg, & Cheese, 6x Mini M & M Sundae, 12x Bacon Cheeseburger, 10x Gingerbread Shake (12 fl oz), 8x Chicken BLT Garden Fresh Salad Wrap- grilled, 13x Southwestern Breakfast Burrito, 11x Double Bacon Cheeseburger, 4x Cinnabon® Roll- One, 13x Seattle’s Best Coffee® Iced Coffee -SMALL, 6x CROISSAN’WICH® Bacon, Egg & Cheese, 10x French Fries – large (Salted), 8x DOUBLE WHOPPER® Sandwich w/o Mayo, 8x Hamburger, 14x Sweet Potato Curly Fries (S), 16x Soft Serve Cup, 10x Bacon, Egg & Cheese Biscuit, 9x BK® Bacon Burger, 6x Ken’s Apple Cider Vinaigrette- packet, 12x Caramel Frappe: 12 fl oz, 7x Sausage, Egg, & Cheese Biscuit, 11x BK VEGGIE® Burger w/o Mayo, 7x Double Cheeseburger, 10x Pancake and Sausage platter, 10x Hash Browns – small, 9x Sweet Potato Curly Fries (L), 10x Apple Slices, 8x Hash Browns – large, 7x Seattle’s Best Coffee® Iced Coffee -SMALL- CARAMEL, 11x Chicken Nuggets (8 pc), 10x Onion Rings – medium, 4x WHOPPER® Sandwich with Cheese w/o Mayo, 6x DOUBLE CROISSAN’WICH™ w/ Sausage, Bacon, Egg, & Cheese, 13x WHOPPER JR.® Sandwich w/o Mayo, 10x Side Caesar Salad and dressing, 4x Vanilla Milk Shake 16 fl oz, 15x BK®Breakfast Muffin Sandwich Sausage and Cheese, 8x Caramel Sundae, 10x Hash Browns – medium, 10x Chocolate Milk Shake 12 fl oz, 9x WHOPPER® Sandwich with Cheese, 3x CROISSAN’WICH® Egg & Cheese, 7x OREO Sundae, 9x Ranch Crispy Chicken Wrap, 11x Soft Serve Cone, 9x Premium Chicken Sandwich- Crispy w/o Mayo, 7x BK® Quad Stacker, 11x Chicken Caesar Garden Fresh Salad with TENDERCRISP and dressing, 5x Mozzarella Sticks (4 pc), 13x Onion Rings – large, 12x Seattle’s Best Coffee® Iced Coffee -LARGE, 10x Ken’s Avocado Ranch Dressing- packet, 8x Premium Chicken Sandwich- Grilled w/o Mayo, 6x Smoothie: Tropical Mango- 16 fl oz, 10x Gingerbread Shake (20 fl oz), 10x Premium Chicken Sandwich- Grilled, 9x Oatmeal Raisin Cookies (2), 12x Pancakes (3) and 1 oz breakfast syrup, 13x Home-style Chicken Strips- 5pc, 7x Chicken Caesar Garden Fresh Salad Wrap- grilled, 12x Country Pork Sandwich, 7x Smoothie: Tropical Mango- 20 fl oz, 8x Original Chicken Sandwich, 11x DOUBLE CROISSAN’WICH™ w/ Bacon, Egg, & Cheese, 10x Chicken BLT Garden Fresh Salad with TENDERGRILL and dressing, 9x 1% Low Fat Chocolate Milk (8 fl oz), 13x Chicken Apple & Cranberry Garden Fresh Salad with TENDERCRISP and dressing, 9x BK® Single Stacker, 14x BK® Double Stacker, 7x Smoothie: Tropical Mango- 12 fl oz, 8x WHOPPER JR.® Sandwich, 12x Ranch Grilled Chicken Wrap, 9x BK® Triple Stacker, 8x Seattle’s Best Coffee® Iced Coffee – MED, 7x BK®Breakfast Muffin Sandwich ham, egg and Cheese, 16x Ken’s Citrus Caesar Dressing- packet, 10x Chicken Nuggets (6 pc), 18x CROISSAN’WICH® Sausage & Cheese, 12x Chicken Caesar Garden Fresh Salad with TENDERGRILL and dressing, 14x Chocolate Chip Cookies (2), 7x Gingerbread Cookie Sundae, 3x BK VEGGIE® Burger, 10x Angry Whopper, 5x BK®Breakfast Muffin Sandwich bacon, egg and Cheese, 10x Sausage Breakfast Burrito, 7x Smoothie: Strawberry Banana 12 fl oz, 10x DOUBLE CROISSAN’WICH™ w/ ham, Egg, & Cheese, 6x Angry Whopper JR., 8x DOUBLE WHOPPER® Sandwich with Cheesew/o Mayo, 8x Fat FREE Milk (8 fl oz), 7x WHOPPER® Sandwich w/o Mayo, 9x Chicken Nuggets (4 pc), 9x Premium Chicken Sandwich- Crispy, 9x Seattle’s Best Coffee® Iced Coffee -SMALL- MOCHA, 12x Chicken Apple and Cranberry Garden Fresh Salad Wrap- grilled, 9x DOUBLE CROISSAN’WICH™ w/ Sausage, Egg, & Cheese, 11x DOUBLE CROISSAN’WICH™ w/ Ham, Sausage, Egg, & Cheese, 5x Mocha Frappe: 20 fl oz, 8x Onion Rings – value, 14x Chicken Caesar Garden Fresh Salad Wrap- crispy, 12x Ken’s Lite Honey Balsamic- packet, 7x Dutch Apple Pie, 7x Gingerbread Shake (16 fl oz), 12x Chocolate Fudge Sundae, 14x Seattle’s Best Coffee® Iced Coffee -SMALL- VANILLA, 8x Strawberry Sundae, 12x Strawberry Milk Shake 12 fl oz, 7x Chicken BLT Garden Fresh Salad with TENDERCRISP and dressing, and a whole lot of water!

(Click to see a McDonalds Order —->)

Daphne Millbrook ran 6,045 miles. To account for burning 713,310 calories, she ate a substantial amount of food from McDonalds. Her order was as follows : 7x Big Breakfast with Egg Whites (Regular Size Biscuit), 4x Premium McWrap Chicken Sweet Chili (Crispy), 6x Nonfat Caramel Mocha (Small), 7x Caramel Latte (Large), 6x Double Cheeseburger, 8x Hotcakes and Sausage, 10x Iced Coffee– Hazelnut (Medium), 10x Premium Bacon Ranch Salad (without chicken), 4x Strawberry Banana Smoothie (Large), 6x Caramel Mocha (Large), 9x Honey Mustard Snack Wrap (Crispy), 2x McDouble, 7x Blueberry Pomegranate Smoothie (Medium), 4x Chipotle BBQ Snack Wrap (Crispy), 8x Sausage Burrito, 8x Strawberry McCafé Shake (22 fl oz cup), 7x Premium McWrap Chicken & Bacon (Grilled), 8x Caramel Mocha (Medium), 11x Ranch Snack Wrap® (Crispy), 9x Strawberry McCafé Shake (12 fl oz cup), 6x Iced Mocha (Small), 7x Chocolate McCafé Shake (12 fl oz cup), 3x Latte with Sugar Free French Vanilla Syrup (Large), 4x Cinnamon Melts, 2x Sausage, Egg & Cheese McGriddles®, 6x Nonfat Latte (Large), 10x Nonfat Hazelnut Latte (Small), 9x Premium Caesar Salad with Crispy Chicken, 7x Small French Fries, 6x French Vanilla Latte (Medium), 5x Ranch Snack Wrap® (Grilled), 9x Chicken McNuggets® (10 piece), 5x Nonfat French Vanilla Latte (Small), 8x Latte (Large), 10x Vanilla McCafé Shake (22 fl oz cup), 12x Hazelnut Latte (Small), 6x Nonfat Hazelnut Latte (Medium), 8x Nonfat French Vanilla Latte (Large), 7x Premium Grilled Chicken Ranch BLT Sandwich, 4x Nonfat Latte (Medium), 6x Frappe Caramel (Medium), 4x Premium Southwest Salad with Crispy Chicken, 5x Sausage Biscuit (Regular Size Biscuit), 9x Premium McWrap Chicken & Bacon (Crispy), 6x Chipotle BBQ Snack Wrap (Grilled), 7x Honey Mustard Snack Wrap (Grilled), 7x Premium Caesar Salad with Crispy Chicken, 9x Filet-O-Fish, 7x Chipotle BBQ Snack Wrap (Crispy), 8x Bacon, Egg & Cheese Biscuit (Regular Size Biscuit), 3x Fruit ‘n Yogurt Parfait, 11x Mocha with Nonfat Milk (Medium), 10x Iced Coffee– French Vanilla (Small), 8x McChicken ®, 8x Premium Grilled Chicken Club Sandwich, 4x Hamburger, 7x Strawberry McCafé Shake (12 fl oz cup), 7x Hazelnut Latte (Large), 7x Iced Caramel Mocha (Large), 3x Nonfat Latte with Sugar Free French Vanilla Syrup (Small), 7x Premium McWrap Chicken Sweet Chili (Grilled), 7x Big Breakfast® (Regular Size Biscuit), 5x Premium Crispy Chicken Club Sandwich, 5x Vanilla McCafé Shake (16 fl oz cup), 8x Iced Coffee– Hazelnut (Small), 6x Latte with Sugar Free French Vanilla Syrup (Small), 13x Frappe Caramel (Large), 7x Sausage, Egg & Cheese McGriddles with Egg Whites, 6x Southern Style Crispy Chicken Sandwich, 8x Fruit ‘n Yogurt Parfait, 9x Side Salad, 3x Nonfat Latte with Sugar Free French Vanilla Syrup (Large), 8x Iced Coffee– Regular (Medium), 7x Premium McWrap Chicken Sweet Chili (Grilled), 5x French Vanilla Latte (Small), 9x Ranch Snack Wrap® (Grilled), 7x Sausage Biscuit with Egg (Large Size Biscuit), 2x Latte (Medium), 6x Frappe Caramel (Small), 10x Premium Caesar Salad with Grilled Chicken, 7x Vanilla McCafé Shake (12 fl oz cup), 6x Snack Size Holiday Mint McFlurry®†, 5x Frappe Chocolate Chip (Small)†, 9x Egg Nog McCafe Shake (16 fl oz cup) Medium†, 10x Iced Mocha with Nonfat Milk (Small), 5x Blueberry Pomegranate Smoothie (Small), 8x Filet-O-Fish, 3x Iced Mocha (Large), 6x Iced Nonfat Caramel Mocha (Small), 10x Premium McWrap Chicken & Ranch (Grilled), 10x McFlurry® with M&M’S® Candies (12 fl oz cup), 7x Premium Bacon Ranch Salad with Grilled Chicken, 7x Caramel Mocha (Small), 6x Sausage Biscuit with Egg (Regular Size Biscuit), 12x Snack Size McFlurry® with OREO® Cookies, 9x Chocolate McCafé Shake (16 fl oz cup), 6x Mango Pineapple Smoothie (Medium), 8x Bacon, Egg & Cheese Biscuit with Egg Whites (RegularBiscuit), 6x Iced Coffee– French Vanilla (Medium), 10x Vanilla McCafé Shake (12 fl oz cup), 6x Chocolate McCafé Shake (22 fl oz cup), 8x Honey Mustard Snack Wrap (Grilled), 12x Caramel Latte (Medium), 5x Egg Nog McCafe Shake (22 fl oz cup) Large†, 12x McFlurry® with OREO® Cookies (16 fl oz cup), 6x Sausage McMuffin with Egg Whites, 5x McCafé Caramel Hot Chocolate with Nonfat Milk (Medium), 5x Side Salad, 4x Sausage Biscuit (Large Size Biscuit), 7x Hotcakes, 10x Iced Nonfat Caramel Mocha (Large), 9x Premium Crispy Chicken Club Sandwich, 5x Nonfat French Vanilla Latte (Medium), 5x Iced Coffee– Regular (Small), 6x Double Quarter Pounder with Cheese++, 7x Chipotle BBQ Snack Wrap (Grilled), 9x Egg Nog McCafe Shake (22 fl oz cup) Large†, 12x Oatmeal Raisin Cookie, 4x Sausage Biscuit with Egg Whites (Regular Size Biscuit), 13x Latte with Sugar Free French Vanilla Syrup (Medium), 5x Chocolate McCafé Shake (16 fl oz cup), 6x Chicken McNuggets® (20 piece)**, 1x Strawberry Banana Smoothie (Small), 5x Mocha (Medium), 6x Apple Slices†, 5x Iced Coffee with Sugar Free French Vanilla Syrup (Large), 3x Mocha with Nonfat Milk (Large), 2x Ranch Snack Wrap® (Grilled), 5x Strawberry McCafé Shake (16 fl oz cup), 6x Hazelnut Latte (Medium), 5x Premium Crispy Chicken Classic Sandwich, 7x Iced Nonfat Caramel Mocha (Medium), 8x Strawberry Banana Smoothie (Medium), 7x Frappe Chocolate Chip (Large), 8x Snack Size McFlurry® with Rolo®†**, 4x Premium McWrap Chicken & Ranch (Crispy), 7x McCafé Caramel Hot Chocolate with Nonfat Milk (Small), 7x Big Breakfast with Hotcakes and Egg Whites (Large Biscuit), 8x Iced Coffee– Caramel (Large), 7x Iced Caramel Mocha (Medium), 11x Quarter Pounder Bacon & Cheese+, 6x Cheeseburger, 5x Southern Style Chicken Biscuit (Regular Size Biscuit), 7x Big Breakfast with Hotcakes (Large Size Biscuit), 3x Bacon, Egg & Cheese McGriddles, 5x Snack Size McFlurry® with Reese’s Peanut Butter Cup® †, 3x Hot Chocolate with Nonfat Milk (Medium), 2x Chocolate Chip Cookie, 8x Quarter Pounder Deluxe+, 7x Sausage McMuffin®, 8x Premium Crispy Chicken Classic Sandwich, 7x Premium McWrap Chicken & Bacon (Crispy), 7x Vanilla McCafé Shake (16 fl oz cup), 8x McFlurry® with M&M’S® Candies (16 fl oz cup), 6x Fruit ‘n Yogurt Parfait, 8x Bacon, Egg & Cheese Biscuit with Egg Whites (Large Biscuit), 5x Strawberry Sundae, 4x Hot Chocolate with Nonfat Milk (Small), 5x Bacon, Egg & Cheese Bagel†, 5x Frappe Chocolate Chip (Medium)†, 5x Chocolate McCafé Shake (22 fl oz cup), 2x Large French Fries, 7x Premium Southwest Salad (without chicken), 4x Premium McWrap Chicken & Ranch (Grilled), 3x Egg White Delight, 5x Iced Coffee– Caramel (Small), 11x Mocha (Large), 8x Nonfat Latte with Sugar Free French Vanilla Syrup (Medium), 3x French Vanilla Latte (Large), 1x Big Breakfast with Hotcakes (Regular Size Biscuit), 6x Premium Southwest Salad with Grilled Chicken, 3x Chicken McNuggets® (6 piece), 2x Sausage McMuffin® with Egg, 5x Nonfat Caramel Mocha (Medium), 7x Mango Pineapple Smoothie (Small), 5x Nonfat Caramel Latte (Large), 5x Hot Caramel Sundae, 3x Latte (Small), 1x Nonfat Caramel Latte (Medium), 7x Mac Snack Wrap†, 5x Premium Grilled Chicken Classic Sandwich, 5x Iced Mocha with Nonfat Milk (Medium), 6x Daily Double†, 4x Mocha with Nonfat Milk (Small), 7x Wild Berry Smoothie (Large), 8x Chicken McNuggets® (4 piece), 7x Premium Bacon Ranch Salad with Crispy Chicken, 6x Sausage McGriddles®, 8x Nonfat Caramel Latte (Small), 5x Vanilla McCafé Shake (22 fl oz cup), 3x Mac Snack Wrap†, 6x McFlurry® with Reese’s Peanut Butter Cup® (16 fl oz cup)†, 6x Big Breakfast® (Large Size Biscuit), 6x Premium Caesar Salad (without chicken), 1x Hash Brown, 8x Bacon, Egg & Cheese Bagel with Egg Whites, 8x Iced Coffee– French Vanilla (Large), 14x Big Breakfast with Hotcakes and Egg Whites (Regular Biscuit), 5x Iced Caramel Mocha (Small), 5x McChicken ®, 5x Iced Coffee– Hazelnut (Large), 8x Strawberry McCafé Shake (16 fl oz cup), 3x McRib ®†, 6x Fruit & Maple Oatmeal without Brown Sugar†, 7x Frappe Mocha (Small), 4x Premium McWrap Chicken & Bacon (Grilled), 10x Premium Crispy Chicken Ranch BLT Sandwich, 6x Kids Fries, 5x Southern Style Crispy Chicken Sandwich, 7x Baked Hot Apple Pie, 5x Frappe Mocha (Large), 4x Frappe Mocha (Medium), 5x Snack Size McFlurry® with M&M’S® Candies, 4x Big Breakfast with Egg Whites (Large Size Biscuit), 5x Premium Crispy Chicken Ranch BLT Sandwich, 5x Quarter Pounder Bacon Habanero Ranch+, 8x Ranch Snack Wrap® (Crispy), 9x Sausage Biscuit with Egg Whites (Large Size Biscuit), 7x Strawberry McCafé Shake (22 fl oz cup), 15x Premium Bacon Ranch Salad with Grilled Chicken, 8x Hot Chocolate (Medium), 8x Iced Mocha with Nonfat Milk (Large), 4x Premium Bacon Ranch Salad with Crispy Chicken, 7x Mocha (Small), 5x Bacon, Egg & Cheese McGriddles with Egg Whites, 2x McFlurry® with OREO® Cookies (12 fl oz cup), 14x Quarter Pounder® with Cheese+, 10x Iced Coffee– Regular (Large), 2x Bacon, Egg & Cheese Biscuit (Large Size Biscuit), 7x Egg McMuffin®, 10x Premium McWrap Chicken & Ranch (Crispy), 7x Nonfat Hazelnut Latte (Large), 10x Southern Style Chicken Biscuit (Large Size Biscuit), 5x Iced Coffee with Sugar Free French Vanilla Syrup (Medium), 8x McCafé Caramel Hot Chocolate with Nonfat Milk (Large), 6x Premium Grilled Chicken Classic Sandwich, 9x Mango Pineapple Smoothie (Large), 3x Premium Southwest Salad with Crispy Chicken, 4x Hot Chocolate (Small), 6x Premium McWrap Chicken Sweet Chili (Crispy), 6x Wild Berry Smoothie (Medium), 6x Chicken Selects® Premium Breast Strips (5 pc), 5x Kiddie Cone, 5x Nonfat Caramel Mocha (Large), 6x Medium French Fries, 2x Ranch Snack Wrap® (Crispy), 4x Premium Grilled Chicken Club Sandwich, 5x Vanilla Reduced Fat Ice Cream Cone, 5x Premium Grilled Chicken Ranch BLT Sandwich, 6x Chipotle BBQ Snack Wrap (Crispy), 3x Blueberry Pomegranate Smoothie (Large), 4x Premium Caesar Salad with Grilled Chicken, 6x Grilled Onion Cheddar, 2x Honey Mustard Snack Wrap (Crispy), 6x Premium Southwest Salad with Crispy Chicken, 10x Fruit & Maple Oatmeal †, 7x Honey Mustard Snack Wrap (Crispy), 6x Honey Mustard Snack Wrap (Grilled), 5x Hot Chocolate with Nonfat Milk (Large), 7x Hot Fudge Sundae, 7x Chocolate McCafé Shake (12 fl oz cup), 5x Iced Coffee with Sugar Free French Vanilla Syrup (Small), 8x Hot Chocolate (Large), 4x Cherry Berry Chiller (Small)†, 6x Chipotle BBQ Snack Wrap (Grilled), 5x Iced Coffee– Caramel (Medium), 3x Nonfat Latte (Small), 10x Egg Nog McCafe Shake (16 fl oz cup) Medium†, 12x Iced Mocha (Medium), 7x Caramel Latte (Small), and a whole lot of water!

(Click to see a Wendys Order —->)

Daphne Millbrook ran 6,045 miles. To account for burning 713,310 calories, she ate a substantial amount of food from Wendys. Her order was as follows : 11x Asiago Ranch Club w/ Ultimate Chicken Gril, 14x Cheddar Cheese, Shredded, 20x Cinna-Middles, 19x Sausage Gravy & Biscuit, 14x Jr. Cheeseburger, 14x Gourmet Croutons, 19x Gourmet Croutons, 21x Rich & Meaty Chili, Small, 12x Homestyle Chicken Fillet, 26x Barq’s® Root Beer, Small Cup, 12x Apple Slices, 16x Ketchup, 13x 6-Piece Spicy Chicken Nuggets, 16x 10-Piece Chicken Nuggets, 22x Baconator®, 15x TruMoo® 1% Lowfat White Milk, 10x Crispy Chicken Sandwich, 18x Toasted Bagel Sandwich with Egg and Cheddar, 16x Premium Toasted Bun, 15x Caramel Frosty Shake, Small, 14x Brown Sugar, 24x Crispy Chicken Caesar Wrap, 15x Hot Sauce, 16x Steel-Cut Oatmeal with Cranberries and Pecans, 15x American Cheese, 15x All Natural Lemonade, Small Cup, 17x Chocolate Frosty Waffle Cone, 17x Mocha Roaster, 14x Jr. Hamburger, 18x Oreo® Brownie, 16x Mocha Iced Coffee, Small, 18x Brewed Sweetened Iced Tea, 15x Artisan Sandwich with Egg & Cheese, 19x Juicy Juice® Apple Juice, 21x Honey Mustard Nugget Sauce, 25x Mayonnaise, 19x Plain Baked Potato (avg. wgt. 10 oz.), 13x Mornin’ Melt Panini with All-Natural Sausage, 10x Light Classic Ranch Dressing, 16x Pibb Xtra®, Small Cup, 20x Natural Asiago Cheese, 18x Apple Pecan Chicken Salad Half-Size, 11x Sour Cream & Chive Baked Potato, 22x Heartland Ranch Dipping Sauce, 19x Chocolate Frosty Shake, Large, 13x Vanilla Frosty Waffle Cone, 17x Honey Butter Chicken Biscuit, 24x Asiago Ranch Club w/ Spicy Chicken, 20x Spicy Chicken Fillet, 12x Steel-Cut Oatmeal with Apples and Caramel, 22x Tortilla, 19x Lemon Garlic Caesar Dressing, 12x Sweet & Sour Nugget Sauce, 19x Baja Chili Salad, 14x Sugar Cookie, 15x Toasted Bagel, Plain, 14x Strawberry Lemonade, Small Cup, 22x Applewood Smoked Bacon – 1 strip, 19x Caramel Frosty Shake, Large, 25x Homestyle Chicken Go Wrap, 18x Chocolate Chunk Cookie, 16x Barbecue Nugget Sauce, 17x 1/2 lb. Double w/ Cheese, 14x Orange Juice, Small, 20x Asiago Ranch Club w/ Homestyle Chicken, 16x Dr Pepper®, Small Cup, 12x Strawberry Frosty Shake, Small, 14x Garden Side Salad, 14x Medium Natural-Cut Fries, 20x Thousand Island Dressing, 11x Coca-Cola®, Small Cup, 22x Vanilla Iced Coffee, Small, 16x Hi-C® Flashin’ Fruit Punch®, Small Cup, 13x Cheeseburger, Kids’ Meal, 21x Ultimate Chicken Grill Fillet, 23x 4-Piece Spicy Chicken Nuggets, 10x TruMoo 1% Lowfat Chocolate Milk, 12x Chicken BLT Cobb Salad Half-Size, 17x Mornin’ Melt™ Panini with Applewood Smoked Bacon, 9x 4-Piece Regular Chicken Nuggets, 18x Son of Baconator®, 18x Roasted Pecans, 20x 1/4 lb. Single w/ Cheese, 14x Chicken BLT Cobb Salad, 14x Value Natural-Cut Fries, 18x Classic Ranch Dressing, 22x Hamburger, Kids’ Meal, 14x Hot Chili Seasoning Packet, 14x Vanilla Frosty, Small, 24x Saltine Crackers, 14x Cheddar Cheese, Shredded, 22x Ultimate Chicken Grill Sandwich, 16x Small Natural-Cut Fries, 14x Caramel Iced Coffee, Small, 16x Grilled Chicken Go Wrap, 12x Italian Vinaigrette Dressing, 16x Baja Chili Salad Half-Size, 14x Jr. Bacon Cheeseburger (JBC), 15x Toasted Bagel Sandwich with Applewood Smoked Bacon, 17x Buttery Best Spread, 15x Avocado Ranch Dressing, 13x Jr. Hamburger Patty, 18x Artisan Egg Sandwich with Applewood Smoked Bacon, 24x Oatmeal Bar, 16x Caesar Side Salad, 18x Smoky Honey Mustard, 13x Red Jalapeño Dressing, 21x Homestyle Chicken Sandwich, 13x Fresh-Baked Biscuit with All-Natural Sausage, 20x Spicy Chicken Caesar Salad, 8x Gourmet Croutons, 17x Strawberry Tea, Small Cup, 16x Skinny Vanilla Iced Coffee, Small, 8x Fanta® Orange, Small Cup, 14x Rich & Meaty Chili, Large, 19x Spicy Chicken Caesar Salad Half-Size, 19x Ketchup, 1 Packet, 16x Large Natural-Cut Fries, 18x Chocolate Frosty, Small, 13x Chili Cheese Fries, 12x Chocolate Frosty Shake, Small, 19x Seasoned Homestyle Potatoes, 14x Sausage & Egg Burrito, 22x Crispy Chicken Patty, 12x Sandwich Bun, 16x Sausage Biscuit, 18x Spicy Chicken Go Wrap, 18x Double Stack™, 13x Fresh-Baked Biscuit with Applewood Smoked Bacon, 16x Spicy Chicken Sandwich, 20x Strawberry Frosty Shake, Large, 25x Artisan Egg Sandwich with All-Natural Sausage, 13x Toasted Bagel Sandwich with All-Natural Sausage, 16x Skinny Vanilla Roaster, 14x 3/4 lb. Triple w/ Cheese, 13x Sprite®, Small Cup, 16x Steel-Cut Oatmeal, Plain, 11x Mornin’ Melt Panini with Egg & Cheese, 19x Buttery Best Spread, 18x Ranch Sauce, 15x Fat-Free French Dressing, 19x Jr. Cheeseburger Deluxe, 12x 1/4 lb.* Hamburger Patty, 12x Pomegranate Vinaigrette Dressing, 24x Minute Maid® Light Lemonade, Small Cup, 14x 6-Piece Regular Chicken Nuggets, 21x Steel-Cut Oatmeal with Summer Berries, 15x Sunny Side Burger, Jr. Single, 17x Lemon Garlic Caesar Dressing, 17x Caramel Roaster, 14x Fresh-Baked Biscuit with Egg & Cheese, 12x Tomato – 1 slice, 15x Seasoned Tortilla Strips, 24x Chocolate Brownie, and a whole lot of water!

Code for the scraper
(Click here —>)

# caloriesScraper.R
library(XML)
 
# Taco Bell has a big ugly headerless table, we'll use XML
taco = "http://www.tacobell.com/nutrition/information"
taco.table <- readHTMLTable(taco, header = c("name", "calories", 1:12), as.data.frame = TRUE, stringsAsFactors = FALSE)
taco.calories <- taco.table$nutrInfo[ c(1,3) ]
colnames(taco.calories) <- c("Item", "Calories")
taco.calories <- taco.calories[ which(taco.calories$Calories > 0), ] #removing NAs
taco.length <- length(taco.calories$Calories)
taco.taco <- vector()
taco.taco[1:taco.length] <- "Taco Bell"
taco.frame <- data.frame(taco.taco, taco.calories$Calories, taco.calories$Item)
# Burger King has a PDF, so we will work a different approach
# http://www.nutrition-charts.com/burger-king-nutritional-information/
burger = "http://www.nutrition-charts.com/burger-king-nutritional-information/"
burger.table <- readHTMLTable(burger, header = TRUE, as.data.frame = TRUE, stringsAsFactors = FALSE)
burger.calories <- burger.table$`NULL`[1:2]
burger.calories <- burger.calories[ which(burger.calories$Calories != "Calories"), ]
burger.calories$Calories <- as.numeric(burger.calories$Calories)
burger.calories <- burger.calories[ which(burger.calories$Calories > 0), ]
burger.length <- length(burger.calories$Calories)
burger.burger <- vector()
burger.burger[1:burger.length] <- "Burger King"
burger.frame <- data.frame(burger.burger, burger.calories$Calories, burger.calories$Item)
# McDonalds
mcdonalds = "http://www.nutrition-charts.com/mcdonalds-nutrition-facts-calorie-information/"
mcdonalds.table <- readHTMLTable(mcdonalds, header = TRUE, as.data.frame = TRUE, stringsAsFactors = FALSE)
mcdonalds.calories <- mcdonalds.table$`NULL`[1:2]
colnames(mcdonalds.calories) <- c("Item", "Calories")
mcdonalds.calories <- mcdonalds.calories[ which(mcdonalds.calories$Calories != "Calories"), ]
mcdonalds.calories$Calories <- as.numeric(mcdonalds.calories$Calories)
mcdonalds.calories <- mcdonalds.calories[ which(mcdonalds.calories$Calories > 0), ]
mcdonalds.length <- length(mcdonalds.calories$Calories)
mcdonalds.mcdonalds <- vector()
mcdonalds.mcdonalds[1:mcdonalds.length] <- "McDonalds"
mcdonalds.frame <- data.frame(mcdonalds.mcdonalds, mcdonalds.calories$Calories, mcdonalds.calories$Item)
# Wendys
wendys = "http://www.nutrition-charts.com/wendys-nutrition-facts-calorie-information/"
wendys.table <- readHTMLTable(wendys, header = TRUE, as.data.frame = TRUE, stringsAsFactors = FALSE)
wendys.calories <- wendys.table$`NULL`[c(1,3)]
colnames(wendys.calories) <- c("Item", "Calories")
wendys.calories <- wendys.calories[ which(wendys.calories$Calories != "Calories"), ]
wendys.calories$Calories <- as.numeric(wendys.calories$Calories)
wendys.calories <- wendys.calories[ which(wendys.calories$Calories > 0), ]
wendys.length <- length(wendys.calories$Calories)
wendys.wendys <- vector()
wendys.wendys[1:wendys.length] <- "Wendys"
wendys.frame <- data.frame(wendys.wendys, wendys.calories$Calories, wendys.calories$Item)
# Dominos ~ servings of
pizza = "http://www.nutrition-charts.com/dominos-pizza-nutrition-facts-calorie-information/"
pizza.table <- readHTMLTable(pizza, header = TRUE, as.data.frame = TRUE, stringsAsFactors = FALSE)
pizza.calories <- pizza.table$`NULL`[1:2]
colnames(pizza.calories) <- c("Item", "Calories")
pizza.calories <- pizza.calories[ which(pizza.calories$Calories != "Calories"), ]
pizza.calories$Calories <- as.numeric(pizza.calories$Calories)
pizza.calories <- pizza.calories[ which(pizza.calories$Calories > 0), ]
pizza.length <- length(pizza.calories$Calories)
pizza.pizza <- vector()
pizza.pizza[1:pizza.length] <- "Dominos"
pizza.frame <- data.frame(pizza.pizza, pizza.calories$Calories, pizza.calories$Item)
# Olive Garden ~ servings of
olive = "http://www.nutrition-charts.com/olive-garden-nutrition-information/"
olive.table <- readHTMLTable(olive, header = TRUE, as.data.frame = TRUE, stringsAsFactors = FALSE)
olive.calories <- olive.table$`NULL`[1:2]
colnames(olive.calories) <- c("Item", "Calories")
olive.calories <- olive.calories[ which(olive.calories$Calories != "Calories"), ]
olive.calories$Calories <- as.numeric(olive.calories$Calories)
olive.calories <- olive.calories[ which(olive.calories$Calories > 0), ]
olive.length <- length(olive.calories$Calories)
olive.olive <- vector()
olive.olive[1:olive.length] <- "Olive Garden"
olive.frame <- data.frame(olive.olive, olive.calories$Calories, olive.calories$Item)
 
shopNames <- c(taco.taco, burger.burger, mcdonalds.mcdonalds, wendys.wendys, pizza.pizza, olive.olive)
itemNames <- c(taco.calories$Item, burger.calories$Item, mcdonalds.calories$Item, wendys.calories$Item, 
               pizza.calories$Item, olive.calories$Item)
caloriesList <- c(taco.calories$Calories, burger.calories$Calories, mcdonalds.calories$Calories, 
                  wendys.calories$Calories, pizza.calories$Calories, olive.calories$Calories)
 
csv.frame <- data.frame(shopNames, itemNames, caloriesList)
colnames(csv.frame) <- c("Shop", "Item", "Calories")
write.csv(csv.frame, row.names = FALSE, file = "reallyFastCalories.csv")

Code for the server.R in Shiny
(Click here —>)

shinyServer(function(input, output) {
  calories.Data <<- read.csv("DATA/reallyFastCalories.csv")
 
  # builds a reactive expression that only invalidates 
  # when the value of input$goButton becomes out of date 
  # (i.e., when the button is pressed)
  ntext <- eventReactive(input$goButton, {
    building <<- "Daphne Millbrook ran 6,045 miles. To account for burning 713,310 calories, she ate a substantial amount of food from "
    building <<- paste(building, input$select, sep = '')
    building <<- paste(building, ". Her order was as follows : ", sep = '')
    sub.Data <<- calories.Data[ which(calories.Data$Shop == input$select), ]
    calorie.count <<- 0
    order.count <<- vector()
    order.count[1:length(sub.Data$Shop)] <<- 0
    order.vector <<- vector()
    while(calorie.count < 713310){
      step.gen <<- sample(1:length(sub.Data$Shop),1)
      order.count[step.gen] <<- order.count[step.gen] + 1
      calorie.count <<- calorie.count + as.numeric(sub.Data$Calories[step.gen])
    }
    word.pieces <<- 0
    for(i in 1:length(sub.Data$Shop)){
      if(order.count[i] > 0){
        order.vector[word.pieces] <<- paste(order.count[i], "x ", sub.Data$Item[i], ", ", sep = '')
        word.pieces <<- word.pieces + 1
      }
    }
    building <<- c(building, sample(order.vector), sep = '') # sample() to evade obvious boring alphabetical order
    return(c(building, "and a whole lot of water!", sep = ''))
  })
 
  output$nText <- renderText({
    ntext()
  })
})

Code for the ui.R in Shiny
(Click here —>)

shinyUI(
  mainPanel(
    selectInput("select", label = h3("Select Restaurant "), 
                choices = list("Taco Bell", "Burger King", "McDonalds", "Wendys", "Dominos", "Olive Garden"), 
                selected = 1),
    actionButton("goButton", "Run, Daphne!"),
    p("Click the button, then Daphne will run from Tokyo to Paris"),
    textOutput("nText")
  )
)

Event Write-up : 03/28/2015 Go Code Colorado Open Data Jam! (3rd Place)

Click here to view the server.R and ui.R source post for this event.
To try my interactive app, use this link
Lots of free data : Colorado Information Marketplace

It's a #Knope approved waffle chart of natural gas reserves at #GCCDataJam <3

A photo posted by Terry (@tcabeen) on

(Me, looking good, serving waffles)

This past Saturday, Go Code Colorado hosted it’s Open Data Jam at Turing School of Software & Design in Denver, Colorado. You can read into the links to get the specifics, but this was my first time taking part in any sort of data event. I arrived promptly at 9AM and was greeted with breakfast pastries and coffee. I enjoyed a maple cinnamon bun, yum. Shortly thereafter some other attendees struck up conversation with me. I asked everyone what environment they would be working in today, almost everyone said Ruby, and many were also making use of the d3 package. Two contestants I spoke with had heard of or used R before. No one I talked to (or that participated, as far as I know) used R for their entry. Organizers explained how the event worked, and walked us through using CIM. Specifically, we were to use datasets under the heading BIC. I was pleasantly surprised at the lack of in-your-face advertising/recruiting, given our physical presence in Turing, a school for Software Developers. Kudos to them. I think the Technical School for Software model that has been rapidly expanding is a great thing. Everyone I met on Saturday was kind and personable.

Sometime around 10:30 contestants broke into teams. I worked solo, though I communicated with a Turing student, and we vetted each others plans. Contest rules disallow preparing code ahead of time, and I was unsure if all datasets from CIM would be available (apparently not!). One of my roommates, a graduate student at Colorado School of Mines, does work with NREL, so I decided to try to use some of their data. NREL has a number of datasets available through CIM under the BIC heading, and I started poking around my options.

The first data I considered were weather readings from 6 Colorado locations. this snowballed into a major blunder. I started downloading the 6 datasets in .csv form (most familiar for me in R). These files were enormous, summing to more than 1 GB. When the day began there were 50 contestants by my approximation (this is important for later). With a large number of people concurrently sharing a wireless connection, most of whom are downloading datasets, speeds slowed to a crawl, sometimes stalling entirely. I made use of this downloading time by drawing out the data structures by hand. I decided I wanted to use only several of the columns, and began looking at available date ranges. Three datasets had data current to Friday, the other three were a year or more out from their most recent reading. The start dates on the three current data sets I had decided to use varied significantly(by more than a decade). I planned to subset the two longer sets so they all fit a common range (the shortest of the three). When the datasets finished downloading I started trying to load them into my R environment, and my computer choked repeatedly. Two hours wasted! Ugh. The 4 o’ clock deadline was looming and I decided to pivot and pick a new dataset. I chose the Colorado Natural Gas Underground Reserves 2014 data. This set was much better suited to limited development time and computing resource management, only 15 KB in size. I repeated my earlier approach, to draw out the data structure to inform my visualization strategy. I completely missed the month column, whoops, this makes my visualization kind of dumb. I will try to go back and have my Shiny app better reflect the data shape. Company, county, working gas capacity, total field capacity, and maximum daily delivery were the variables I decided to work with. I had recently read a blog post about a new addition to CRAN, the waffle package.

Waffles are delicious.
Waffles are delicious.

My strategy was to produce a R/Shiny implementation that allows the user to select (County or Company) and (Working Gas Capacity or Total Field Capacity or Maximum Daily Delivery) and serve a waffle() accordingly. Being intimately familiar with issues in debugging Shiny apps, my first step was to produce the six charts as an insurance against (the eventual) failure of my Shiny app to be finished. At about 2:30 I had my insurance plan charts made and ready to go if necessary.
remember earlier when I said there were 50 contestants?

by now, more than half of them had left. considering only four prizes would be given, this was pretty sweet.

I was dragging pretty hard, but committed to delivering a visualization.

that equity, though.
that equity, though.

Generating the waffle() charts was trivial, and I moved on to the task of wrapping the desires processes up into Shiny, which is not just an adjective! I kind of resent RStudio for naming Shiny, invariably when I mention my skills in Shiny development in person, I must explain that Shiny is a front end for R, with the purpose of serving WebApps, and that I am not just describing the visual appeal of my projects.

As projected, I was unable to make Shiny work out. Luckily I am skilled at risk management, and was able to submit my charts and generating source in time for the 4:00 PM deadline.

The judges convened, then around 4:15 the four standing teams gave their presentations. I went last. I believe the teams were sized: 7, 6, 1(he started with more, they left), and 1 (me).

The first team gave a dazzling presentation of water rights transactions in Colorado since the 1800s, I believe. You could drag the slider and see the water rights transaction locations represented by an icon for that year, laid over a map. Everyone but me used maps! I wanted to avoid maps but I might have to use them in the future if I want to win.

A cool extension of this project might be to allow range selection, like 1897-1915.

The second team presented farmers market locations in relation to demographic data. Their presentation was in-depth and insightful.

It would be interesting to be able to bring a time slider into this project!

The third team gave an interesting map of AT&T cellular deadzones on Colorado highways. I’ve definitely been more frustrated about more frequent cellular signal failure here in Colorado vs. the East Coast, though I am on Verizon.

This project could be extended by mapping other strength bands. I believe AT&T was the only carrier available for this data, but it would be really cool to be able to drop-down select a carrier to see their map.

***

I presented fourth, and a well-timed joke about Leslie Knope, waffles, and how everyone hates pie charts landed.

do you know what time it is?
do you know what time it is?

I won 3rd place! And a fitbit! And some Google Cloud Credits (I think? haven’t received yet)!

In conclusion, I am competitive, data is awesome, and the organizations and people I interacted with on Saturday were awesome. Excited for my next event.

R/Shiny NREL Waffle Visualization Open Data Jam Source

Click here to use the live, interactive app.
The blog post that refers to these source files.
Below, find the server.R and ui.R source for my (post) completed R/Shiny WebApp, visualizing NREL Natural Gas Underground Storage 2014 data

# server.R
library(waffle)
 
shinyServer(function(input, output, session) {
  cPalette <<- rainbow(10)
  parts <<- vector()
  # Open Data Jam ~ March 28 2015
  # Go Code Colorado @ Turing School 1510 Blake St, Denver, CO
 
  # data.Gas <<- read.csv("DATA/naturalGasUnderground.csv")
  data.Gas <<- read.csv("DATA/naturalGasUnderground.csv")
  data.Gas <<- subset(data.Gas, select = c("County.Name", "Company.Name", "WorkingGasCapacity.Mcf.",
                                          "TotalFieldCapacity.Mcf.", "MaximumDailyDelivery.Mcf."))
  Counties <<- unique(data.Gas$County.Name)
  numCounties <<- length(Counties)
  countyParts <<- 
  Companies <<- unique(data.Gas$Company.Name)
  numCompanies <<- length(Companies)
  # 0 the NAs
 
  data.Gas$WorkingGasCapacity.Mcf.[is.na(data.Gas$WorkingGasCapacity.Mcf.)] <<- 0
  data.Gas$TotalFieldCapacity.Mcf.[is.na(data.Gas$TotalFieldCapacity.Mcf.)] <<- 0
  data.Gas$MaximumDailyDelivery.Mcf.[is.na(data.Gas$MaximumDailyDelivery.Mcf.)] <<- 0
 
  # pre-load the data to serve
  dailyCounty <<- vector()
  for(i in 1:numCounties){
    dailyCounty[i] <<- sum(data.Gas$MaximumDailyDelivery.Mcf.[ which(data.Gas$County.Name == Counties[i])])/1000000
  }
  names(dailyCounty) <<- Counties
  dailyCounty <<- sort(dailyCounty, decreasing = TRUE)
  #
  workingCounty <<- vector()
  for(i in 1:numCounties){
    workingCounty[i] <<- sum(data.Gas$WorkingGasCapacity.Mcf.[ which(data.Gas$County.Name == Counties[i])])/1000000
  }
  names(workingCounty) <<- Counties
  workingCounty <<- sort(workingCounty, decreasing = TRUE)
  #
  totalCounty <<- vector()
  for(i in 1:numCounties){
    totalCounty[i] <<- sum(data.Gas$TotalFieldCapacity.Mcf.[ which(data.Gas$County.Name == Counties[i])])/1000000
  }
  names(totalCounty) <<- Counties
  totalCounty <<- sort(totalCounty, decreasing = TRUE)
  ####
  dailyCompany <<- vector()
  for(i in 1:numCompanies){
    dailyCompany[i] <<- sum(data.Gas$MaximumDailyDelivery.Mcf.[ which(data.Gas$Company.Name == Companies[i])])/1000000
  }
  names(dailyCompany) <<- Companies
  dailyCompany <<- sort(dailyCompany, decreasing = TRUE)
  #
  workingCompany <<- vector()
  for(i in 1:numCompanies){
    workingCompany[i] <<- sum(data.Gas$WorkingGasCapacity.Mcf.[ which(data.Gas$Company.Name == Companies[i])])/1000000
  }
  names(workingCompany) <<- Companies
  workingCompany <<- sort(workingCompany, decreasing = TRUE)
  #
  totalCompany <<- vector()
  for(i in 1:numCompanies){
    totalCompany[i] <<- sum(data.Gas$TotalFieldCapacity.Mcf.[ which(data.Gas$Company.Name == Companies[i])])/1000000
  }
  names(totalCompany) <<- Companies
  totalCompany <<- sort(totalCompany, decreasing = TRUE)
  #
 
 
 
  output$plot1 <- renderPlot({
    column1 = input$col1
    column2 = input$col2
    titleVar <<- paste(column2, " sliced by ", column1, sep = "")
    # col1, col2
    if(column1 == "County"){
      cPalette <<- palette(rainbow(numCounties)) 
 
      if(column2 == "Maximum Daily Delivery"){
        parts <<- dailyCounty
      }
      else if(column2 == "Working Gas Capacity"){
        parts <<- workingCounty
      }
      else{ # Total Field Capacity
        parts <<- totalCounty
      } 
    }
    else{ # Company
      cPalette <<- palette(rainbow(numCompanies))
 
      if(column2 == "Maximum Daily Delivery"){
        parts <<- dailyCompany
      }
      else if(column2 == "Working Gas Capacity"){
        parts <<- workingCompany
      }
      else{ # Total Field Capacity
        parts <<- totalCompany
      }
    }
 
    if(length(parts > 0)){
      waffle(parts, rows = 15, size = 1, palette(rainbow(length(parts))), 
             title = titleVar, 
             xlab="One square == 1 Million Mcf")
    }
  })
 
})
# ui.R
shinyUI(pageWithSidebar(
  headerPanel('Natural Gas Underground Storage NREL Data : Waffle Style!'),
  sidebarPanel(
    selectInput('col1', 'Slice by...', c("County", "Company")),
    selectInput('col2', 'Data Measure', c("Maximum Daily Delivery",
                                                "Working Gas Capacity",
                                                "Total Field Capacity")
                )
  ),
                mainPanel(
                  plotOutput('plot1')
                )
    ))