Viewing datasets interactively with view

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.

Getting ready

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))

How to do it…

Incanter makes this very easy. Let's take a look at just how simple it is:

  1. First, we need to load the dataset, as follows:
    user=> (def iris (get-dataset :iris))
    #'user/iris
  2. Then we just call 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:

How to do it…

How it works…

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.

See also…

  • Chapter 11, Graphing in Incanter, for more sophisticated and exciting ways to visualize Incanter datasets
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.188.178.181