Book Image

Clojure Data Analysis Cookbook - Second Edition

By : Eric Richard Rochester
Book Image

Clojure Data Analysis Cookbook - Second Edition

By: Eric Richard Rochester

Overview of this book

Table of Contents (19 chapters)
Clojure Data Analysis Cookbook Second Edition
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Composing Cascalog queries


One of the best things about Cascalog queries is that they can be composed together. Similar to composing functions, this can be a good way to build a complex process from smaller, easy-to-understand parts.

In this recipe, we'll parse the Virginia census data we first used in the Managing program complexity with STM recipe in Chapter 3, Managing Complexity with Concurrent Programming. You can download this data from http://www.ericrochester.com/clj-data-analysis/data/all_160_in_51.P35.csv. We'll also use a new census datafile that contains the race data. You can download it from http://www.ericrochester.com/clj-data-analysis/data/all_160_in_51.P3.csv.

Getting ready

Since we're reading CSV, we'll need to use the dependencies and imports from the Parsing CSV files with Cascalog recipe.

We'll also use the hfs-text-delim function from that recipe and ->long from the Aggregating data with Cascalog recipe.

Also, we'll need the data files from http://www.ericrochester.com...