Book Image

Clojure Data Analysis Cookbook - Second Edition

By : Eric Richard Rochester
Book Image

Clojure Data Analysis Cookbook - Second Edition

By: Eric Richard Rochester

Overview of this book

Table of Contents (19 chapters)
Clojure Data Analysis Cookbook Second Edition
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

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 it works…

Incanter's view function takes any...