Sometimes, we're more interested in how values change than we are in the values themselves. This information is latent in the data, but making it explicit makes it easier to work with and visualize.
First, we'll use the following dependencies in our project.clj
file.
:dependencies [[org.clojure/clojure "1.4.0"] [incanter "1.4.1"]]
We also need to require Incanter in our script or REPL.
(require '[incanter.core :as i] 'incanter.io)
Finally, we'll use the Virginia census data. You can download the file from http://www.ericrochester.com/clj-data-analysis/data/all_160_in_51.P3.csv.
(def data-file "data/all_160_in_51.P3.csv")
For this recipe, we'll take some census data and add a column to show the change in population between the 2000 and 2010 censuses.
We need to read in the data.
(def data (incanter.io/read-dataset data-file :header true))
If we look at the values in the field for the year 2000 census population, some...