Although datasets are often convenient, many times we'll want something a bit faster. Incanter matrices store a table of doubles. This provides
good performance in a compact data structure. We'll also need matrices many times because some of Incanter's functions, trans
, for example, only operate on a single matrix.
Also, it implements Clojure's ISeq interface, so interacting with matrices is also convenient.
For this recipe, we'll need the Incanter libraries, so we'll use this project.clj
file:
:dependencies [[org.clojure/clojure "1.4.0"] [incanter "1.4.1"]]
We'll use the core
and io
namespaces, so we'll load those into our script or REPL:
(use '(incanter core io))
We'll use the Virginia census data that we've used periodically throughout the book. Refer to the Managing program complexity with STM recipe from Chapter 3, Managing Complexity with Concurrent Programming, for information on how to get this dataset. You can also download...