So far we've been focusing on splitting datasets up,
on dividing them into groups of rows or groups of columns with functions and macros such as $
or $where
. However, sometimes we'd like to move in the other direction. We may have two, related datasets, and we'd like to join them together to make a larger one.
First, we'll need to include these dependencies in our project.clj
file.
:dependencies [[org.clojure/clojure "1.4.0"] [incanter "1.4.1"]]
We'll use the following statements for includes:
(use '(incanter core io charts) '[clojure.set :only (union)])
For our data file, we'll use the census data that we used in the Converting datasets to matrices recipe. You can download this from http://www.ericrochester.com/clj-data-analysis/data/all_160_in_51.P35.csv. Save it to data/all_160_in_51.P35.csv
.
We'll also use a new data file, data/all_160_in_51.P3.csv
. This contains the race questions from the census for Virginia....