Being able to interact with our data programmatically is important, but sometimes it's also helpful to be able to look at it. This can be especially useful when you do data exploration.
We'll need to have Incanter in our project.clj
file and script or REPL, so we'll use the same setup as we did for the Loading Incanter's sample datasets recipe, as follows. We'll also use the Iris dataset from that recipe.
(use '(incanter core datasets))
Incanter makes this very easy. Let's take a look at just how simple it is:
user=> (def iris (get-dataset :iris)) #'user/iris
view
on the dataset:user=> (view iris)
This function returns the Swing window frame, which contains our data, as shown in the following screenshot. This window should also be open on your desktop, although for me, it's usually hiding behind another window:
Incanter's view
function takes any object and tries to display it graphically. In this case, it simply displays the raw data as a table. We'll use this function a lot in Chapter 11, Graphing in Incanter, when we talk about Incanter's graphing functionality.