September 2015
Beginner to intermediate
608 pages
13h 43m
English
We encountered categorical variables in the previous chapter as the dichotomous variable "sex" in the athlete dataset. That dataset also contained many other categorical variables including "sport", "event", and "country".
Let's take a look at the Titanic dataset (using the clojure.java.io library to access the file resource and the incanter.io library to read it in):
(defn load-data [file]
(-> (io/resource file)
(str)
(iio/read-dataset :delim \tab :header true)))
(defn ex-4-1 []
(i/view (load-data :titanic)))The preceding code generates the following table:

The Titanic dataset includes categorical variables too. For example—:sex ...
Read now
Unlock full access