github
Advanced Search
  • Home
  • Pricing and Signup
  • Explore GitHub
  • Blog
  • Login

liebke / incanter

  • Admin
  • Watch Unwatch
  • Fork
  • Your Fork
  • Pull Request
  • Download Source
    • 196
    • 16
  • Source
  • Commits
  • Network (16)
  • Issues (0)
  • Downloads (4)
  • Wiki (6)
  • Graphs
  • Branch: master

click here to add a description

click here to add a homepage

  • Branches (6)
    • gh-pages
    • master ✓
    • new
    • nomodules
    • oldbuild
    • working
  • Tags (0)
Sending Request…
Enable Donations

Pledgie Donations

Once activated, we'll place the following badge in your repository's detail box:
Pledgie_example
This service is courtesy of Pledgie.

Clojure-based, R-like statistical computing and graphics environment for the JVM — Read more

  cancel

http://incanter.org

  cancel
  • Private
  • Read-Only
  • HTTP Read-Only

This URL has Read+Write access

Added incanter-pdf module (not installed by default, use 'mvn install' 
from modules/incanter-pdf directory to install), and example project that 
uses it in /examples/blog/project/pdf-chart. 
liebke (author)
Sat Feb 06 12:22:16 -0800 2010
commit  225481ee56e6d99cf9aa7fcafd25f2090ee10e03
tree    624adff3659374a35635d4cf675ae5f65efa9738
parent  00d81c4453d0983426da9e0d5ae110702a582287
incanter /
name age
history
message
file .gitignore Wed Dec 23 06:01:03 -0800 2009 fix typo [alexott]
file README.textile Mon Jan 04 18:22:40 -0800 2010 Updated README. [liebke]
directory bin/ Mon Jan 04 10:59:32 -0800 2010 fix scripts to use new bundle names bin/clj & ... [alexott]
directory data/ Tue Dec 29 09:55:41 -0800 2009 removed extra whitespace in sample datasets. [David Liebke]
directory docs/ Sat Dec 12 13:02:19 -0800 2009 removed pre-generated api docs, run bin/generat... [liebke]
file epl-v10.html Wed Mar 11 20:10:13 -0700 2009 added Eclipse Public License file [liebke]
directory examples/ Sat Feb 06 12:22:16 -0800 2010 Added incanter-pdf module (not installed by def... [liebke]
directory modules/ Sat Feb 06 12:22:16 -0800 2010 Added incanter-pdf module (not installed by def... [liebke]
file pom.xml Thu Feb 04 07:07:53 -0800 2010 Changed Maven groupId from incanter to org.inca... [liebke]
file user.clj Sat Apr 18 19:01:55 -0700 2009 added user.clj that loads clojure.contrib.repl-... [liebke]
README.textile

Incanter

  • Overview
  • Getting started with Clojure
  • Getting started with Incanter
  • Documentation and examples
  • Building Incanter
  • Dependencies

Overview and motivation

Incanter is a Clojure-based, R-like statistical computing and graphics environment for the JVM. At the core of Incanter are the Parallel Colt numerics library, a multithreaded version of Colt, and the JFreeChart charting library, as well as several other Java and Clojure libraries.

The motivation for creating Incanter is to provide a JVM-based statistical computing and graphics platform with R-like semantics and interactive-programming environment. Running on the JVM provides access to the large number of existing Java libraries for data access, data processing, and presentation. Clojure’s seamless integration with Java makes leveraging these libraries much simpler than is possible in R, and Incanter’s R-like semantics makes statistical programming much simpler than is possible in pure Java.

Motivation for a Lisp-based R-like statistical environment can be found in the paper Back to the Future: Lisp as a Base for a Statistical Computing System by Ihaka and Lang (2008). Incanter is also inspired by the now dormant Lisp-Stat (see the special volume in the Journal of Statistical Software on Lisp-Stat: Past, Present, and Future from 2005).

Motivation for a JVM-based Lisp can be found at the Clojure website, and screencasts of several excellent Clojure talks by the language’s creator, Rich Hickey, can be found at clojure.blip.tv.

Getting started with Clojure

For a great introduction to programming in Clojure, read Clojure – Functional Programming for the JVM. by R. Mark Volkmann. For an even more extensive introduction, get the newly released book Programming Clojure by Stuart Halloway.

Other Clojure resources

  • Clojure website
  • Clojure Google group
  • clojure.blip.tv
  • Clojure Programming Wikibook
  • Learning Clojure Wikibook

Getting started with Incanter

Start by visiting the Incanter website for an overview, checkout the documentation page for a listing of HOW-TOs and examples, and then download a pre-built version of Incanter, which includes all the necessary dependencies, and unpack the file (if you would like to build it from source, read Building Incanter).

Start the Clojure shell (aka the REPL) from the Incanter directory: bin/clj or bin\clj.bat on Windows (note: if you want to start the Clojure REPL from a directory other than the top level Incanter directory, change the INCANTER_HOME variable in the clj script so that it uses an absolute path instead the ./ directory).

You can also start Incanter directly with the following command:
java -jar modules/incanter-app/target/incanter-app-*.jar
This will start a Clojure REPL, but will not have command history like the clj scripts. If you want to use the built-in data sets, you’ll also need to set the incanter.home property as follows:
java -Dincanter.home=/path/to/incanter/dir -jar modules/incanter-app/target/incanter-app-*.jar

From the Clojure shell, load the Incanter libraries:

(use '(incanter core stats charts))

Try an example: sample 1,000 values from a standard-normal distribution and view a histogram:

(view (histogram (sample-normal 1000)))

Try another simple example, a plot of the sine function over the range -4 to 4:

(view (function-plot sin -4 4))

The online documentation for most Incanter functions contain usage examples. The documentation can be viewed using Clojure’s doc function. For example, to view the documentation and usage examples for the linear-model function, call (doc linear-model) from the Clojure shell. Use (find-doc "search term") to search the online documentation from the Clojure shell. The API documentation can also be found at http://liebke.github.com/incanter.

More Incanter examples

  • See the Incanter blog
  • See Incanter wiki
    • Sample plots
    • Matrices
    • Datasets
    • Statistics examples
    • Probability distributions
  • See the examples/ directory for additional usage examples.
    • bin/clj examples/run_prob_plots.clj to generate example probability distribution plots

Documentation

The following documentation covers the Incanter and Clojure APIs and the APIs of the underlying java libraries.

Incanter documentation

  • Doc Index
  • API

Related API documentation

  • Clojure API
    *"Clojure-contrib API":http://richhickey.github.com/clojure-contrib/
  • Parallel Colt Java API
  • JFreeChart Java API
    Processing API
    Joda Time API

Building Incanter

To build and test Incanter, you will need to have Maven and git installed:

  • First, clone the Incanter Github repository: git clone git://github.com/liebke/incanter.git
  • cd into the incanter directory
  • use Maven to build, test, and install Incanter: mvn install
  • to build Incanter without running tests or installing jars in the Maven repository, run: mvn package -Dmaven.test.skip=true

To start up a Clojure REPL with Incanter and its dependencies in the CLASSPATH, run: bin/clj (or on Windows bin/clj.bat)

or run: mvn clojure:repl , from the modules/incanter-app directory

or run java -jar modules/incanter-app/target/incanter-app-1.0-master-SNAPSHOT.jar

A Swank server can be started with the bin/swank script or by running mvn clojure:swank, from the modules/incanter-app directory, which can be connected to with M-x slime-connect within Emacs.

(Note: the bin/clj and *.clj scripts won’t run on Windows systems as is. Although, the Clojure code contained in the *.clj scripts can be run from the Clojure shell.)

Included dependencies

See lib/license.txt file for license terms of included libraries.

  • Clojure
  • Parallel Colt
    • Netlib-Java (included with Parallel Colt)
  • JFreeChart
    • JCommon (included with JFreeChart)
    • GnuJaxp (included with JFreeChart)
  • OpenCSV
  • JGraph (for future development)
  • Clojure-Contrib
  • JLine
  • Joda Time
Blog | Support | Training | Contact | API | Status | Twitter | Help | Security
© 2010 GitHub Inc. All rights reserved. | Terms of Service | Privacy Policy
Powered by the Dedicated Servers and
Cloud Computing of Rackspace Hosting®
Dedicated Server