<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Data Sorcery with Clojure</title>
	<atom:link href="http://data-sorcery.org/feed/" rel="self" type="application/rss+xml" />
	<link>http://data-sorcery.org</link>
	<description></description>
	<lastBuildDate>Sun, 25 Nov 2012 02:16:17 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='data-sorcery.org' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://1.gravatar.com/blavatar/d4b5a8433d351a7b2112a1db63d9ffd8?s=96&#038;d=http%3A%2F%2Fs2.wp.com%2Fi%2Fbuttonw-com.png</url>
		<title>Data Sorcery with Clojure</title>
		<link>http://data-sorcery.org</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://data-sorcery.org/osd.xml" title="Data Sorcery with Clojure" />
	<atom:link rel='hub' href='http://data-sorcery.org/?pushpress=hub'/>
		<item>
		<title>Hammock Driven Development Cheat Sheet</title>
		<link>http://data-sorcery.org/2010/12/29/hammock-driven-dev/</link>
		<comments>http://data-sorcery.org/2010/12/29/hammock-driven-dev/#comments</comments>
		<pubDate>Wed, 29 Dec 2010 18:57:27 +0000</pubDate>
		<dc:creator>liebke</dc:creator>
				<category><![CDATA[Clojure]]></category>
		<category><![CDATA[design]]></category>
		<category><![CDATA[clojure hammocks design]]></category>

		<guid isPermaLink="false">http://data-sorcery.org/?p=1807</guid>
		<description><![CDATA[This last weekend I re-watched Rich Hickey&#8217;s excellent (I would say awesome, but he would disapprove) clojure-conj talk on Hammock Driven Development, which I&#8217;ve summarized into this one page cheat sheet. The talk isn&#8217;t specific to Clojure, and the ideas &#8230; <a href="http://data-sorcery.org/2010/12/29/hammock-driven-dev/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=data-sorcery.org&#038;blog=7974443&#038;post=1807&#038;subd=incanter&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>This last weekend I re-watched Rich Hickey&#8217;s excellent (I would say awesome, but he would disapprove) clojure-conj talk on <a href="http://clojure.blip.tv/file/4457042/">Hammock Driven Development</a>, which I&#8217;ve summarized into this <a href="http://incanter.org/images/misc/hammock-driven-dev.png">one page cheat sheet</a>. The talk isn&#8217;t specific to Clojure, and the ideas can, and have, been applied to domains outside of programming. I recommend it for anybody working on solving novel problems in any domain.</p>
<p><a href="http://incanter.org/images/misc/hammock-driven-dev.png"><img width="500" src="http://incanter.org/images/misc/hammock-driven-dev.png" /></a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/incanter.wordpress.com/1807/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/incanter.wordpress.com/1807/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=data-sorcery.org&#038;blog=7974443&#038;post=1807&#038;subd=incanter&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://data-sorcery.org/2010/12/29/hammock-driven-dev/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/0a0458c58526d153dbc2639eed0d592e?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">liebke</media:title>
		</media:content>

		<media:content url="http://incanter.org/images/misc/hammock-driven-dev.png" medium="image" />
	</item>
		<item>
		<title>An Illustrated guide to multi-core parallelism in Clojure</title>
		<link>http://data-sorcery.org/2010/10/23/clojureconj/</link>
		<comments>http://data-sorcery.org/2010/10/23/clojureconj/#comments</comments>
		<pubDate>Sat, 23 Oct 2010 23:39:15 +0000</pubDate>
		<dc:creator>liebke</dc:creator>
				<category><![CDATA[Clojure]]></category>
		<category><![CDATA[clojureconj]]></category>

		<guid isPermaLink="false">http://data-sorcery.org/?p=1801</guid>
		<description><![CDATA[Here are my Clojure Conj slides, From Concurrency to Parallelism: an illustrated guide to multi-core parallelism in Clojure. The version of clojure.par I used isn&#8217;t publicly available yet, but I will be publishing it in my github repo (github.com/liebke/clojure) soon, &#8230; <a href="http://data-sorcery.org/2010/10/23/clojureconj/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=data-sorcery.org&#038;blog=7974443&#038;post=1801&#038;subd=incanter&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>Here are my <a href="http://first.clojure-conj.org/">Clojure Conj</a> slides, <a href="http://incanter.org/downloads/fjclj.pdf">From Concurrency to Parallelism: an illustrated guide to multi-core parallelism in Clojure</a>. The version of clojure.par I used isn&#8217;t publicly available yet, but I will be publishing it in my github repo (<a href="http://github.com/liebke/clojure">github.com/liebke/clojure</a>) soon, and hopefully it will make its way to master in the not too distant future.</p>
<p>I just want to thank everybody at the Conj for making it such a spectacular event! I&#8217;m already looking forward to next year.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/incanter.wordpress.com/1801/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/incanter.wordpress.com/1801/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=data-sorcery.org&#038;blog=7974443&#038;post=1801&#038;subd=incanter&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://data-sorcery.org/2010/10/23/clojureconj/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/0a0458c58526d153dbc2639eed0d592e?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">liebke</media:title>
		</media:content>
	</item>
		<item>
		<title>Incanter executables</title>
		<link>http://data-sorcery.org/2010/06/12/incanter-executables/</link>
		<comments>http://data-sorcery.org/2010/06/12/incanter-executables/#comments</comments>
		<pubDate>Sat, 12 Jun 2010 22:30:48 +0000</pubDate>
		<dc:creator>liebke</dc:creator>
				<category><![CDATA[Clojure]]></category>
		<category><![CDATA[Incanter]]></category>
		<category><![CDATA[swingrepl]]></category>

		<guid isPermaLink="false">http://data-sorcery.org/?p=1763</guid>
		<description><![CDATA[For a long time I&#8217;ve wanted a simple, double-clickable executable for Incanter, and now thanks to Alan Dipert&#8217;s swingrepl library I have it. I have made an executable jar file, called incanter.jar, that launches a swingrepl, that includes Incanter and &#8230; <a href="http://data-sorcery.org/2010/06/12/incanter-executables/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=data-sorcery.org&#038;blog=7974443&#038;post=1763&#038;subd=incanter&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>For a long time I&#8217;ve wanted a simple, double-clickable executable for <a href="http://incanter.org">Incanter</a>, and now thanks to <a href="http://github.com/alandipert">Alan Dipert&#8217;s</a> <a href="http://github.com/alandipert/clj-swingrepl">swingrepl</a> library I have it.</p>
<p>I have made an executable jar file, called <a href="http://incanter.org/downloads/incanter.jar">incanter.jar</a>, that launches a swingrepl, that includes Incanter and all of its dependencies, when double-clicked or started with the following command</p>
<pre>java -jar incanter.jar</pre>
<p><img src="http://incanter.org/images/examples/swingrepl/swingrepl-mac.png" height="300" width="450" /></p>
<p>Note: Make sure to save <a href="http://incanter.org/downloads/incanter.jar">incanter.jar</a> with the .jar extension to ensure it executes correctly.</p>
<p>I have also used Apple&#8217;s Jar Bundler and <a href="http://www.skoobysoft.com/utilities/dmgp.html">SkoobySoft&#8217;s DMG Packager</a> to create a Mac OS X executable that&#8217;s downloadable as a dmg file, <a href="http://incanter.org/downloads/Incanter.dmg">Incanter.dmg</a>.</p>
<p><img src="http://incanter.org/images/examples/swingrepl/incanter-taskbar.png" width="450" /></p>
<p>Finally, I used <a href="http://launch4j.sourceforge.net/">Launch4j</a> to create the Windows executable file,<br />
<a href="http://incanter.org/downloads/Incanter.exe">Incanter.exe</a>.</p>
<p><img src="http://incanter.org/images/examples/swingrepl/swingrepl-win.png" height="300" width="450" /></p>
<p>To build <a href="http://incanter.org/downloads/incanter.jar">incanter.jar</a> from source, use <code>script/package</code> in the Incanter distribution on <a href="http://github.com/liebke/incanter">Github</a>, or just use <code>lein uberjar</code> (lein will call the file incanter-standalone.jar, and will create a non-executable jar called incanter.jar).</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/incanter.wordpress.com/1763/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/incanter.wordpress.com/1763/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=data-sorcery.org&#038;blog=7974443&#038;post=1763&#038;subd=incanter&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://data-sorcery.org/2010/06/12/incanter-executables/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/0a0458c58526d153dbc2639eed0d592e?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">liebke</media:title>
		</media:content>

		<media:content url="http://incanter.org/images/examples/swingrepl/swingrepl-mac.png" medium="image" />

		<media:content url="http://incanter.org/images/examples/swingrepl/incanter-taskbar.png" medium="image" />

		<media:content url="http://incanter.org/images/examples/swingrepl/swingrepl-win.png" medium="image" />
	</item>
		<item>
		<title>Reading and writing Excel (xls) files with Incanter</title>
		<link>http://data-sorcery.org/2010/05/31/xls-files/</link>
		<comments>http://data-sorcery.org/2010/05/31/xls-files/#comments</comments>
		<pubDate>Mon, 31 May 2010 00:25:49 +0000</pubDate>
		<dc:creator>liebke</dc:creator>
				<category><![CDATA[Clojure]]></category>
		<category><![CDATA[Excel]]></category>
		<category><![CDATA[Incanter]]></category>
		<category><![CDATA[plotting]]></category>
		<category><![CDATA[visualization]]></category>
		<category><![CDATA[xls]]></category>

		<guid isPermaLink="false">http://data-sorcery.org/?p=1720</guid>
		<description><![CDATA[I have just added David James Humphreys&#8217; incanter-excel module to the Incanter distribution, providing basic capabilities for reading Microsoft Excel spreadsheets in as Incanter datasets and saving datasets back out as xls files. I have posted a simple spreadsheet of &#8230; <a href="http://data-sorcery.org/2010/05/31/xls-files/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=data-sorcery.org&#038;blog=7974443&#038;post=1720&#038;subd=incanter&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>I have just added <a href="http://github.com/davidjameshumphreys">David James Humphreys&#8217;</a> <em>incanter-excel</em> module to the <a href="http://incanter.org">Incanter</a> distribution, providing basic capabilities for reading Microsoft Excel spreadsheets in as Incanter datasets and saving datasets back out as xls files.</p>
<p>I have posted a <a href="http://incanter.org/data/aus-airline-passengers.xls">simple spreadsheet</a> of Australian airline passenger data from the 1950s to the Incanter website for the following example. The read-xls function can read xls files given either a filename or URL, so you won&#8217;t need to download the file.</p>
<p><img src="http://incanter.org/images/examples/aus-airline-data-xls.png" /></p>
<p>Start by loading the necessary libraries, including incanter.excel.<br />
<pre class="brush: plain;">
(use '(incanter core charts excel))
</pre></p>
<p>Next, we can use the <em>with-data</em> macro to bind a dataset converted from the above xls file, using the <em>read-xls</em> function, and then view it. </p>
<p><pre class="brush: plain;">
(with-data (read-xls &quot;http://incanter.org/data/aus-airline-passengers.xls&quot;)
  (view $data)
</pre></p>
<p><img src="http://incanter.org/images/examples/aus-airline-data.png" /></p>
<p>The read-xls function takes an optional argument called <em>:sheet</em> that takes either the name or index of the worksheet from the xls file to read (in this case either &#8220;dataset&#8221; or 0) , it defaults to 0. </p>
<p>[NOTE: A current weakness of <em>read-xls</em> is that cells containing formulae, as opposed to actual data, are not imported (i.e. the cells remain empty).]</p>
<p>Finally, we&#8217;ll create a time-series plot of the data. However, the <em>time-series-plot</em> needs time in milliseconds, so we&#8217;ll first create a function that converts the date column from <em>Java Date</em> objects to milliseconds, and then view the plot.</p>
<p><pre class="brush: plain;">
  (let [to-millis (fn [dates] (map #(.getTime %) dates))] 
    (view (time-series-plot (to-millis ($ :date)) ($ :passengers)))))
</pre></p>
<p><img src="http://incanter.org/images/examples/xls-timeseries-plot.png" /></p>
<p>Datasets can also be saved as Excel files using the <em>save-xls</em> function. The following example just reads in one of the sample datasets using <em>incanter.datasets/get-dataset</em> and then saves it as an xls file.</p>
<p><pre class="brush: plain;">
(save-xls (get-dataset :cars) &quot;/tmp/cars.xls&quot;)
</pre></p>
<p>The <em>incanter-excel</em> module is now included in the Incanter distribution on <a href="http://github.com/liebke/incanter">Github</a>, and is available as a separate dependency from the <a href="http://clojars.org">Clojars</a> repository. The complete code from this example can be found <a href="http://gist.github.com/419403">here</a>.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/incanter.wordpress.com/1720/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/incanter.wordpress.com/1720/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=data-sorcery.org&#038;blog=7974443&#038;post=1720&#038;subd=incanter&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://data-sorcery.org/2010/05/31/xls-files/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/0a0458c58526d153dbc2639eed0d592e?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">liebke</media:title>
		</media:content>

		<media:content url="http://incanter.org/images/examples/aus-airline-data-xls.png" medium="image" />

		<media:content url="http://incanter.org/images/examples/aus-airline-data.png" medium="image" />

		<media:content url="http://incanter.org/images/examples/xls-timeseries-plot.png" medium="image" />
	</item>
		<item>
		<title>Infix mathematical notation in Incanter</title>
		<link>http://data-sorcery.org/2010/05/14/infix-math/</link>
		<comments>http://data-sorcery.org/2010/05/14/infix-math/#comments</comments>
		<pubDate>Fri, 14 May 2010 21:11:56 +0000</pubDate>
		<dc:creator>liebke</dc:creator>
				<category><![CDATA[Clojure]]></category>
		<category><![CDATA[Incanter]]></category>

		<guid isPermaLink="false">http://data-sorcery.org/?p=1660</guid>
		<description><![CDATA[I obviously love Clojure&#8217;s prefix notation, but there are times when it is more concise, and familiar, to represent mathematical formulae using infix notation, so I have integrated the infix portion of Jeffrey Bester&#8217;s Clojure math library into Incanter. There &#8230; <a href="http://data-sorcery.org/2010/05/14/infix-math/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=data-sorcery.org&#038;blog=7974443&#038;post=1660&#038;subd=incanter&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>I obviously love Clojure&#8217;s prefix notation, but there are times when it is more concise, and familiar, to represent mathematical formulae using infix notation, so I have integrated the infix portion of Jeffrey Bester&#8217;s <a href="http://github.com/jbester/cljext/blob/master/cljext/math.clj">Clojure math library</a> into <a href="http://incanter.org">Incanter</a>. There is now a formula macro called <code>$=</code> for evaluating infix mathematical formulas in incanter.core. </p>
<p>Here&#8217;s an example,<br />
<pre class="brush: plain;">
user&gt; (use 'incanter.core)
nil
user&gt; ($= 7 + 8 - 2 * 6 / 2)
9
</pre></p>
<p>Note that there must be spaces between values and operators. </p>
<p>Vectors can be used instead of scalars. For instance, to add 5 to each element of the vector [1 2 3],<br />
<pre class="brush: plain;">
user&gt; ($= [1 2 3] + 5)
(6 7 8)
</pre></p>
<p>or perform element-by-element arithmetic on vectors and matrices.<br />
<pre class="brush: plain;">
user&gt; ($= [1 2 3] + [4 5 6])
(5 7 9)

user&gt; ($= [1 2 3] * [1 2 3])
(1 4 9)

user&gt; ($= [1 2 3] / [1 2 3])
(1 1 1)

user&gt; ($= (matrix [[1 2] [4 5]]) + 6)
[ 7.0000  8.0000
10.0000 11.0000]

user&gt; ($= (trans [[1 2] [4 5]]) + 6)
[7.0000 10.0000
8.0000 11.0000]
</pre></p>
<p>Examples of exponents using the ** function.<br />
<pre class="brush: plain;">
user&gt; ($= 8 ** 3)
512.0

user&gt; ($= 8 ** 1/2)
2.8284271247461903

user&gt; ($= 2 ** -2)
0.25

user&gt; ($= [1 2 3] ** 2)
(1.0 4.0 9.0)
</pre></p>
<p>Parens can be used for grouping,<br />
<pre class="brush: plain;">
user&gt; ($= 10 + 20 * (4 - 5) / 6)
20/3

user&gt; ($= (10 + 20) * 4 - 5 / 6)
715/6

user&gt; ($= 10 + 20 * (4 - 5 / 6))
220/3
</pre></p>
<p>including arbitrarily nested groupings.<br />
<pre class="brush: plain;">
user&gt; ($= ((((5 + 4) * 5))))
45
</pre></p>
<p>Of course, variables can be used within the formula macro,<br />
<pre class="brush: plain;">
user&gt; (let [x 10
            y -5]
        ($= x + y / -10))
21/2
</pre></p>
<p>and mathematical functions like sin, cos, tan, sq, sqrt, etc. can be used with standard Clojure prefix notation.<br />
<pre class="brush: plain;">
user&gt; ($= (sqrt 5) * 5 + 3 * 3)
20.18033988749895

user&gt; ($= sq [1 2 3] + [1 2 3])
(2 6 12)

user&gt; ($= sin 2 * Math/PI * 2)
5.713284232087328

user&gt; ($= (cos 0) * 10)
10.0

user&gt; ($= (tan 2) * Math/PI * 10)
-68.64505182223235

user&gt; ($= (asin 1/2) * 10)
5.23598775598299

user&gt; ($= (acos 1/2) * 10)
10.47197551196598

user&gt; ($= (atan 1/2) * 10)
4.636476090008061
</pre></p>
<p>Functions can also be applied to vectors,<br />
<pre class="brush: plain;">
user&gt; ($= [1 2 3] / (sq [1 2 3]) + [5 6 7])
(6 13/2 22/3)

user&gt; ($= [1 2 3] + (sin [4 5 6]))
(0.2431975046920718 1.0410757253368614 2.720584501801074)
</pre></p>
<p>Boolean tests are also supported.<br />
<pre class="brush: plain;">
user&gt; ($= 3 &gt; (5 * 2/7))
true

user&gt; ($= 3 &lt;= (5 * 2/7))
false

user&gt; ($= 3 != (5 * 2/7))
true

user&gt; ($= 3 == (5 * 2/7))
false

user&gt; ($= 3 != 8 &amp;&amp; 6 &lt; 12)
true

user&gt; ($= 3 != 8 || 6 &gt; 12)
true
</pre></p>
<p>Matrix multiplication uses the &lt;*&gt; function (equivalent to R&#8217;s %*% operator).<br />
<pre class="brush: plain;">
user&gt; ($= [1 2 3] &lt;*&gt; (trans [1 2 3]))
[1.0000 2.0000 3.0000
2.0000 4.0000 6.0000
3.0000 6.0000 9.0000]

user&gt; ($= (trans [[1 2] [4 5]]) &lt;*&gt; (matrix [[1 2] [4 5]]))
[17.0000 22.0000
22.0000 29.0000]

user&gt; ($= (trans [1 2 3 4]) &lt;*&gt; [1 2 3 4])
30.0

user&gt; ($= [1 2 3 4] &lt;*&gt; (trans [1 2 3 4]))
[1.0000 2.0000  3.0000  4.0000
2.0000 4.0000  6.0000  8.0000
3.0000 6.0000  9.0000 12.0000
4.0000 8.0000 12.0000 16.0000]
</pre></p>
<p>The Kronecker product uses the &lt;x&gt; function (equivalent to R&#8217;s %x% operator).<br />
<pre class="brush: plain;">
user&gt; ($= [1 2 3] &lt;x&gt; [1 2 3])
[1.0000
2.0000
3.0000
2.0000
4.0000
6.0000
3.0000
6.0000
9.0000]

user&gt; ($= (matrix [[1 2] [3 4] [5 6]]) &lt;x&gt; 4)
[ 4.0000  8.0000
12.0000 16.0000
20.0000 24.0000]

user&gt; ($= (matrix [[1 2] [3 4] [5 6]]) &lt;x&gt; (matrix [[1 2] [3 4]]))
[ 1.0000  2.0000  2.0000  4.0000
 3.0000  4.0000  6.0000  8.0000
 3.0000  6.0000  4.0000  8.0000
 9.0000 12.0000 12.0000 16.0000
 5.0000 10.0000  6.0000 12.0000
15.0000 20.0000 18.0000 24.0000]

user&gt; ($= [1 2 3 4] &lt;x&gt; 4)
[ 4.0000
 8.0000
12.0000
16.0000]

user&gt; ($= [1 2 3 4] &lt;x&gt; (trans [1 2 3 4]))
[1.0000 2.0000  3.0000  4.0000
2.0000 4.0000  6.0000  8.0000
3.0000 6.0000  9.0000 12.0000
4.0000 8.0000 12.0000 16.0000]
</pre></p>
<p>Here&#8217;s an example using the formula macro in a function-plot of <img src='http://s0.wp.com/latex.php?latex=x%5E3+-+5x%5E2+%2B+3x+%2B5+&amp;bg=ffffff&amp;fg=333333&amp;s=0' alt='x^3 - 5x^2 + 3x +5 ' title='x^3 - 5x^2 + 3x +5 ' class='latex' />, (I will use the incanter.latex/add-latex function to add a LaTeX annotation to the chart).</p>
<p><pre class="brush: plain;">
(use '(incanter core charts latex))
(doto (function-plot (fn [x] ($= x ** 3 - 5 * x ** 2 + 3 * x + 5)) -10 10)
  (add-latex 0 250 &quot;x^3 - 5x^2 + 3x +5&quot;)
  view)
</pre></p>
<p><img src="http://incanter.org/images/examples/infix_cubic_fn_ex1.png" /></p>
<p>The next example will use the car-speed-to-breaking-distance sample data (the :cars dataset). I&#8217;ll partition the data, first selecting rows where the ratio of dist/speed is less than 2, then selecting rows where the ratio is greater than 2, and finally adding a line showing this threshold.</p>
<p>First, use the <code>with-data</code> macro, passing it the :cars sample data.  Then apply the <code>$where</code> function in order to filter the data; pass it a <code>$fn</code>, which is a bit of syntax sugar around Clojure&#8217;s <code>fn</code> function that does map destructuring for functions that operate on dataset rows. For instance </p>
<p>($fn [x y] (&#8230;)) </p>
<p>becomes  </p>
<p>(fn [{:keys x y}] (&#8230;))</p>
<p>The parameter names specified in $fn must correspond to the column names of the dataset.</p>
<p><pre class="brush: plain;">
(use '(incanter core datasets charts))
(with-data (get-dataset :cars)
  (doto (scatter-plot :speed :dist 
          :data ($where ($fn [speed dist] 
                          ($= dist / speed &lt; 2))))
    (add-points :speed :dist 
      :data ($where ($fn [speed dist] 
                      ($= dist / speed &gt;= 2))))
    (add-lines ($ :speed) ($= 2 * ($ :speed)))
    view))
</pre></p>
<p><img src="http://incanter.org/images/examples/infix_cars_ex1.png" /></p>
<p>The complete code for this post is available <a href="http://gist.github.com/401524">here</a>.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/incanter.wordpress.com/1660/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/incanter.wordpress.com/1660/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=data-sorcery.org&#038;blog=7974443&#038;post=1660&#038;subd=incanter&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://data-sorcery.org/2010/05/14/infix-math/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/0a0458c58526d153dbc2639eed0d592e?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">liebke</media:title>
		</media:content>

		<media:content url="http://incanter.org/images/examples/infix_cubic_fn_ex1.png" medium="image" />

		<media:content url="http://incanter.org/images/examples/infix_cars_ex1.png" medium="image" />
	</item>
		<item>
		<title>Adding LaTeX equations to Incanter charts</title>
		<link>http://data-sorcery.org/2010/04/14/latex/</link>
		<comments>http://data-sorcery.org/2010/04/14/latex/#comments</comments>
		<pubDate>Wed, 14 Apr 2010 03:51:05 +0000</pubDate>
		<dc:creator>liebke</dc:creator>
				<category><![CDATA[Clojure]]></category>
		<category><![CDATA[Incanter]]></category>
		<category><![CDATA[jFreeChart]]></category>
		<category><![CDATA[LaTeX]]></category>

		<guid isPermaLink="false">http://data-sorcery.org/?p=1637</guid>
		<description><![CDATA[I&#8217;ve added a new library to Incanter called incanter.latex that adds the ability to include LaTeX formatted equations as annotations and subtitles in charts. The library is based on the fantastically useful JLaTeXMath library. The following examples require Incanter version &#8230; <a href="http://data-sorcery.org/2010/04/14/latex/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=data-sorcery.org&#038;blog=7974443&#038;post=1637&#038;subd=incanter&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>I&#8217;ve added a new library to <a href="http://incanter.org">Incanter</a> called <em>incanter.latex</em> that adds the ability to include LaTeX formatted equations as annotations and subtitles in charts. The library is based on the fantastically useful <a href="http://forge.scilab.org/index.php/p/jlatexmath/">JLaTeXMath</a> library.</p>
<p>The following examples require Incanter version 1.2.2-SNAPSHOT or greater. Add the following dependency to your project.clj file:<br />
<pre class="brush: plain;">
[incanter &quot;1.2.2-SNAPSHOT&quot;]
</pre></p>
<p>Load the necessary libraries.</p>
<p><pre class="brush: plain;">
(use '(incanter core stats charts latex))
</pre></p>
<p>Define the latex-formatted equation; I&#8217;ll use the <em>str</em> function so I can break the equation across multiple lines. Notice that I have to use two backslashes where I would only need one if I were were working directly in LaTeX; this is because the backslash is an escape character in Clojure/Java strings.</p>
<p><pre class="brush: plain;">
(def eq (str &quot;f(x)=\\frac{1}{\\sqrt{2\\pi \\sigma^2}}&quot; 
             &quot;e^{\\frac{-(x - \\mu)^2}{2 \\sigma^2}}&quot;))
</pre></p>
<p>The equation can be rendered as an image with the <em>latex</em> function. The rendered equation can then be viewed in a window or saved as a png file with the <em>view</em> and <em>save</em> functions respectively.</p>
<p><pre class="brush: plain;">
(view (latex eq))
(save (latex eq) filename)
</pre></p>
<p><img src="http://incanter.org/images/examples/latex/normal-pdf-latex.png" /></p>
<p>Use the <em>add-latex</em> function to add an annotation to a chart. The following example adds the above equation to a <em>function-plot</em> of the Normal PDF.</p>
<p><pre class="brush: plain;">
(doto (function-plot pdf-normal -3 3)
  (add-latex 0 0.1 eq)
  view)
</pre><br />
<img src="http://incanter.org/images/examples/latex/latex-chart-anno.png" /></p>
<p>Use the <em>add-latex-subtitle</em> function to add a rendered LaTeX equation as a subtitle to the chart (this particular chart does not have a main title).</p>
<p><pre class="brush: plain;">
(doto (function-plot pdf-normal -3 3)
  (add-latex-subtitle eq)
  view)
</pre><br />
<img src="http://incanter.org/images/examples/latex/latex-chart-title.png" /></p>
<p>The complete code for the above examples can be found <a href="https://gist.github.com/2f99f799e11c98a33ec9">here</a>.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/incanter.wordpress.com/1637/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/incanter.wordpress.com/1637/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=data-sorcery.org&#038;blog=7974443&#038;post=1637&#038;subd=incanter&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://data-sorcery.org/2010/04/14/latex/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/0a0458c58526d153dbc2639eed0d592e?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">liebke</media:title>
		</media:content>

		<media:content url="http://incanter.org/images/examples/latex/normal-pdf-latex.png" medium="image" />

		<media:content url="http://incanter.org/images/examples/latex/latex-chart-anno.png" medium="image" />

		<media:content url="http://incanter.org/images/examples/latex/latex-chart-title.png" medium="image" />
	</item>
		<item>
		<title>New default theme and customization features for Incanter charts</title>
		<link>http://data-sorcery.org/2010/04/04/new-chart-theme/</link>
		<comments>http://data-sorcery.org/2010/04/04/new-chart-theme/#comments</comments>
		<pubDate>Sun, 04 Apr 2010 22:56:43 +0000</pubDate>
		<dc:creator>liebke</dc:creator>
				<category><![CDATA[Clojure]]></category>
		<category><![CDATA[Incanter]]></category>
		<category><![CDATA[jFreeChart]]></category>
		<category><![CDATA[plotting]]></category>
		<category><![CDATA[visualization]]></category>

		<guid isPermaLink="false">http://data-sorcery.org/?p=1613</guid>
		<description><![CDATA[I just updated Incanter&#8216;s default chart theme. The new theme is inspired by Hadley Wickham&#8216;s awesome ggplot2 package for R. The first example is my usual &#8220;hello world&#8221; chart, a histogram of data sampled from a normal distribution. The next &#8230; <a href="http://data-sorcery.org/2010/04/04/new-chart-theme/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=data-sorcery.org&#038;blog=7974443&#038;post=1613&#038;subd=incanter&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>I just updated <a href="http://incanter.org">Incanter</a>&#8216;s default chart theme. The new theme is inspired by <a href="http://had.co.nz/">Hadley Wickham</a>&#8216;s awesome <a href="http://had.co.nz/ggplot2/">ggplot2</a> package for <a href="http://www.r-project.org">R</a>.</p>
<p>The first example is my usual &#8220;hello world&#8221; chart, a histogram of data sampled from a normal distribution.</p>
<p><pre class="brush: plain;">
(use '(incanter core charts stats datasets))

(view (histogram (sample-normal 1000)))
</pre></p>
<p><img src="http://incanter.org/images/examples/newtheme/hist-norm.png" /></p>
<p>The next example is a scatter plot of the sepal-length vs. sepal-width from the built-in iris data set.</p>
<p><pre class="brush: plain;">
(view (scatter-plot :Sepal.Length :Sepal.Width :data (get-dataset :iris)))
</pre><br />
<img src="http://incanter.org/images/examples/newtheme/scatter-iris.png" /></p>
<p>In addition to changing the default theme, I have included new functions for customizing the appearance of the charts. Here&#8217;s an example of the <em>set-stroke</em> function, used here to change the color of the data points in the previous chart.</p>
<p><pre class="brush: plain;">
(doto (scatter-plot :Sepal.Length :Sepal.Width :data (get-dataset :iris))
  (set-stroke-color java.awt.Color/gray)
  view)
</pre></p>
<p><img src="http://incanter.org/images/examples/newtheme/scatter-iris-gray.png" /></p>
<p>The next example uses the <em>:group-by</em> option to color the points based on their species.</p>
<p><pre class="brush: plain;">
(view (scatter-plot :Sepal.Length :Sepal.Width 
                    :group-by :Species 
                    :data (get-dataset :iris)))
</pre></p>
<p><img src="http://incanter.org/images/examples/newtheme/scatter-iris-grouped.png" /></p>
<p>This example uses <em>function-plot</em> to create an <em>xy-plot</em> of the <em>sine</em> and <em>cosine</em> functions.</p>
<p><pre class="brush: plain;">
(doto (function-plot sin -10 10)
  (add-function cos -10 10)
  view)
</pre></p>
<p><img src="http://incanter.org/images/examples/newtheme/xy-sincos.png" /></p>
<p>This example uses the <em>$rollup</em> and <em>bar-chart</em> functions to plot the data from the built-in hair-eye-color data set.</p>
<p><pre class="brush: plain;">
(with-data (-&gt;&gt;  (get-dataset :hair-eye-color)
             ($rollup :sum :count [:hair :eye]))
  (view (bar-chart :hair :count :group-by :eye :legend true)))
</pre></p>
<p><img src="http://incanter.org/images/examples/newtheme/barchart-haireye.png" /></p>
<p>This example uses the <em>box-plot</em> function to plot data from three gamma distributions.</p>
<p><pre class="brush: plain;">
(doto (box-plot (sample-gamma 1000 :shape 1 :rate 2)
                :legend true :y-label &quot;&quot;)
  view 
  (add-box-plot (sample-gamma 1000 :shape 2 :rate 2))
  (add-box-plot (sample-gamma 1000 :shape 3 :rate 2)))
</pre></p>
<p><img src="http://incanter.org/images/examples/newtheme/box-gamma.png" /></p>
<p>The following examples are based on the charts in figure 4.2 of chapter four of &#8220;<a href="http://www.manning.com/fogus/">The Joy of Clojure</a>&#8220;, where the performance characteristics of Clojure&#8217;s data structures are discussed.</p>
<p>First define the two functions to plot, and the range of values to plot them over.</p>
<p><pre class="brush: plain;">
(defn log32 [x] (/ (log x) (log 32)))
(defn f1 [n] (plus (log2 n) (mult (log32 n) 5000)))
(defn f2 [n] n)

(def min-val 10)
(def max-val 40000)
</pre></p>
<p>Next, create the plot and use the <em>set-stroke</em> function to increase the stroke thickness for both lines, and make the second line dashed.</p>
<p><pre class="brush: plain;">
(def chart (doto (function-plot f1 min-val max-val 
                   :legend true 
                   :series-label &quot;O(log2 n) + O(log32 n) * 5000&quot;
                   :x-label &quot;&quot;
                   :y-label &quot;&quot;)
             (add-function f2 min-val max-val 
                           :step-size 5000 
                           :series-label &quot;O(n)&quot;) 
             (set-stroke :width 2)
             (set-stroke :width 2 :dataset 1 :dash 5)))

(view chart)
</pre></p>
<p>The three charts in the book are of the same data but each focuses on a different region. You can use the <em>set-y-range</em> and <em>set-x-range</em> functions to zoom-in on each of the different regions.</p>
<p><pre class="brush: plain;">
;; PLOT (A)
(doto chart
  (set-title &quot;(A)&quot;)
  (set-x-range 100 5000)
  (set-y-range 30 12000))
</pre></p>
<p><img src="http://incanter.org/images/examples/newtheme/xy-log32a.png" /></p>
<p><pre class="brush: plain;">
;; PLOT (B)
(doto chart
  (set-title &quot;(B)&quot;)
  (set-y-range 10000 16000)
  (set-x-range 10000 16000))
</pre></p>
<p><img src="http://incanter.org/images/examples/newtheme/xy-log32b.png" /></p>
<p><pre class="brush: plain;">
;; PLOT (C)
(doto chart
  (set-title &quot;(C)&quot;)
  (set-y-range 0 30000)
  (set-x-range 0 30000))
</pre></p>
<p><img src="http://incanter.org/images/examples/newtheme/xy-log32c.png" /></p>
<p>The new theme is available in the latest version of Incanter on <a href="http://clojars.org/incanter">Clojars</a> and <a href="http://github.com/liebke/incanter">Github</a>, and the complete code for the above examples is available <a href="https://gist.github.com/0f2ed9cdba3230044b56">here</a>.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/incanter.wordpress.com/1613/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/incanter.wordpress.com/1613/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=data-sorcery.org&#038;blog=7974443&#038;post=1613&#038;subd=incanter&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://data-sorcery.org/2010/04/04/new-chart-theme/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/0a0458c58526d153dbc2639eed0d592e?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">liebke</media:title>
		</media:content>

		<media:content url="http://incanter.org/images/examples/newtheme/hist-norm.png" medium="image" />

		<media:content url="http://incanter.org/images/examples/newtheme/scatter-iris.png" medium="image" />

		<media:content url="http://incanter.org/images/examples/newtheme/scatter-iris-gray.png" medium="image" />

		<media:content url="http://incanter.org/images/examples/newtheme/scatter-iris-grouped.png" medium="image" />

		<media:content url="http://incanter.org/images/examples/newtheme/xy-sincos.png" medium="image" />

		<media:content url="http://incanter.org/images/examples/newtheme/barchart-haireye.png" medium="image" />

		<media:content url="http://incanter.org/images/examples/newtheme/box-gamma.png" medium="image" />

		<media:content url="http://incanter.org/images/examples/newtheme/xy-log32a.png" medium="image" />

		<media:content url="http://incanter.org/images/examples/newtheme/xy-log32b.png" medium="image" />

		<media:content url="http://incanter.org/images/examples/newtheme/xy-log32c.png" medium="image" />
	</item>
		<item>
		<title>Incanter has migrated to Leiningen</title>
		<link>http://data-sorcery.org/2010/04/01/leiningen/</link>
		<comments>http://data-sorcery.org/2010/04/01/leiningen/#comments</comments>
		<pubDate>Thu, 01 Apr 2010 02:05:14 +0000</pubDate>
		<dc:creator>liebke</dc:creator>
				<category><![CDATA[clojars.org]]></category>
		<category><![CDATA[Clojure]]></category>
		<category><![CDATA[Incanter]]></category>
		<category><![CDATA[labrepl]]></category>
		<category><![CDATA[Leiningen]]></category>
		<category><![CDATA[Maven]]></category>

		<guid isPermaLink="false">http://data-sorcery.org/?p=1597</guid>
		<description><![CDATA[I have completed the process of migrating Incanter from the Maven build tool to Leiningen. Incanter now includes several project.clj files, one for the overall project and one for each submodule. The top-level project.clj file builds what was formerly called &#8230; <a href="http://data-sorcery.org/2010/04/01/leiningen/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=data-sorcery.org&#038;blog=7974443&#038;post=1597&#038;subd=incanter&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>I have completed the process of migrating <a href="http://incanter.org">Incanter</a> from the <a href="http://maven.apache.org/">Maven</a> build tool to <a href="http://github.com/technomancy/leiningen">Leiningen</a>. </p>
<p>Incanter now includes several <em>project.clj</em> files, one for the overall project and one for each submodule. The top-level project.clj file builds what was formerly called <em>incanter-app/incanter-full</em> using the modules <em>incanter-core</em>, <em>incanter-charts</em>, <em>incanter-processing</em>, <em>incanter-io</em>, <em>incanter-pdf</em>, and <em>incanter-mongodb</em>. </p>
<p>The modules live in the <em>modules/</em> directory, and each is an independent Leiningen project that can be built as a standalone library.</p>
<p>The <em>script/</em> directory has <em>repl</em> and <em>swank</em> scripts (both <em>sh</em> and <em>bat</em>) stolen from <a href="http://github.com/relevance/labrepl">labrepl</a>, and simple scripts for managing the builds of all the modules (<em>install</em>, <em>test</em>, <em>clean</em>).</p>
<p>One bonus of this change is that I have been able to push Incanter and its modules back on to <a href="http://clojars.org">Clojars.org</a>.</p>
<p>To include the full library as a dependency in your Leiningen project, add the following entry to your <em>project.clj</em> file:<br />
<pre class="brush: plain;">[incanter &quot;1.2.1-SNAPSHOT&quot;]</pre></p>
<p>If you only want to include a subset of Incanter&#8217;s functionality in your project, use one of the following modules instead:<br />
<pre class="brush: plain;">
 [incanter/incanter-core &quot;1.2.1-SNAPSHOT&quot;]
 [incanter/incanter-charts &quot;1.2.1-SNAPSHOT&quot;]
 [incanter/incanter-io &quot;1.2.1-SNAPSHOT&quot;]
 [incanter/incanter-processing &quot;1.2.1-SNAPSHOT&quot;]
 [incanter/incanter-pdf &quot;1.2.1-SNAPSHOT&quot;]
 [incanter/incanter-mongodb &quot;1.2.1-SNAPSHOT&quot;]
</pre></p>
<p>Updated build instructions can be found in the new README available in <a href="http://github.com/liebke/incanter">Incanter&#8217;s Github repository</a>.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/incanter.wordpress.com/1597/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/incanter.wordpress.com/1597/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=data-sorcery.org&#038;blog=7974443&#038;post=1597&#038;subd=incanter&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://data-sorcery.org/2010/04/01/leiningen/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/0a0458c58526d153dbc2639eed0d592e?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">liebke</media:title>
		</media:content>
	</item>
		<item>
		<title>Dynamic data tables with Incanter</title>
		<link>http://data-sorcery.org/2010/03/26/dynamic-data-tables/</link>
		<comments>http://data-sorcery.org/2010/03/26/dynamic-data-tables/#comments</comments>
		<pubDate>Fri, 26 Mar 2010 05:11:53 +0000</pubDate>
		<dc:creator>liebke</dc:creator>
				<category><![CDATA[Clojure]]></category>
		<category><![CDATA[Incanter]]></category>

		<guid isPermaLink="false">http://data-sorcery.org/?p=1555</guid>
		<description><![CDATA[In a previous post, Dynamic charts with Incanter, I demonstrated how sliders can be linked to either an xy-plot or a scatter-plot. In this post I&#8217;ll demonstrate how sliders can be used to manipulate a dataset query, and dynamically update &#8230; <a href="http://data-sorcery.org/2010/03/26/dynamic-data-tables/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=data-sorcery.org&#038;blog=7974443&#038;post=1555&#038;subd=incanter&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>In a previous post, <a href="http://data-sorcery.org/2010/03/22/dynamic-charts/">Dynamic charts with Incanter</a>, I demonstrated how sliders can be linked to either an <em>xy-plot</em> or a <em>scatter-plot</em>. In this post I&#8217;ll demonstrate how sliders can be used to manipulate a dataset query, and dynamically update the results in a table.</p>
<p>Start by using the <em>get-dataset</em> function to load the iris sample data. Next, create a Swing JTable object containing the data with the <em>data-table</em> function, and then <em>view</em> it. </p>
<p><pre class="brush: plain;">
(use '(incanter core charts datasets))

(let [data (get-dataset :iris)
      table (data-table data)]
  (view table)
</pre></p>
<p>Use the <em>sliders</em> macro to create two sliders; one bound to <em>species</em>, a vector of iris species values, and the other bound to <em>min-petal-length</em>, a range of petal-lengths that will provide the lower bound for a query, and then create the expression that will be evaluated when the sliders are manipulated. </p>
<p><pre class="brush: plain;">
  (sliders [species [&quot;setosa&quot; &quot;virginica&quot; &quot;versicolor&quot;]
            min-petal-length (range 0 8 0.1)]
    (set-data table ($where {:Species species 
                             :Petal.Length {:gt min-petal-length}} 
                            data))))
</pre></p>
<p>In this case, the expression uses the <em>set-data</em> multi-method to update the values of the <em>data-table</em> with the results from a $where query.</p>
<p>Manipulating the sliders changes the query values, and dynamically updates the rows in the table.</p>
<p><img src="http://incanter.org/images/examples/sliders/sliders-iris-species.png" /></p>
<p><img src="http://incanter.org/images/examples/sliders/sliders-iris-petal-len.png" /></p>
<p><img src="http://incanter.org/images/examples/sliders/sliders-iris-table.png" /></p>
<p>Although it would be more natural to use a drop-down option menu, check-boxes, or radio-buttons to manipulate the species values, this example demonstrates that non-numeric values can be bound to sliders.</p>
<p><img src="http://incanter.org/images/examples/sliders/sliders-iris-species2.png" /></p>
<p><img src="http://incanter.org/images/examples/sliders/sliders-iris-petal-len2.png" /></p>
<p><img src="http://incanter.org/images/examples/sliders/sliders-iris-table2.png" /></p>
<p>The <em>data-table</em> function and <em>set-data</em> multi-method are available in the latest version of Incanter on <a href="http://github.com/liebke/incanter">Github</a> and on <a href="http://repo.incanter.org">repo.incanter.org</a>.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/incanter.wordpress.com/1555/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/incanter.wordpress.com/1555/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=data-sorcery.org&#038;blog=7974443&#038;post=1555&#038;subd=incanter&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://data-sorcery.org/2010/03/26/dynamic-data-tables/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/0a0458c58526d153dbc2639eed0d592e?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">liebke</media:title>
		</media:content>

		<media:content url="http://incanter.org/images/examples/sliders/sliders-iris-species.png" medium="image" />

		<media:content url="http://incanter.org/images/examples/sliders/sliders-iris-petal-len.png" medium="image" />

		<media:content url="http://incanter.org/images/examples/sliders/sliders-iris-table.png" medium="image" />

		<media:content url="http://incanter.org/images/examples/sliders/sliders-iris-species2.png" medium="image" />

		<media:content url="http://incanter.org/images/examples/sliders/sliders-iris-petal-len2.png" medium="image" />

		<media:content url="http://incanter.org/images/examples/sliders/sliders-iris-table2.png" medium="image" />
	</item>
		<item>
		<title>Getting started with Incanter using labrepl</title>
		<link>http://data-sorcery.org/2010/03/25/getting-started-with-incanter-using-labrepl/</link>
		<comments>http://data-sorcery.org/2010/03/25/getting-started-with-incanter-using-labrepl/#comments</comments>
		<pubDate>Thu, 25 Mar 2010 01:36:49 +0000</pubDate>
		<dc:creator>liebke</dc:creator>
				<category><![CDATA[Clojure]]></category>
		<category><![CDATA[compojure]]></category>
		<category><![CDATA[Incanter]]></category>
		<category><![CDATA[labrepl]]></category>
		<category><![CDATA[Leiningen]]></category>

		<guid isPermaLink="false">http://data-sorcery.org/?p=1532</guid>
		<description><![CDATA[Stuart Halloway created a great Clojure tutorial and development environment for the PragmaticStudio Clojure workshop called labrepl, which is available on Github. A nice feature of labrepl is that is comes with several Clojure libraries, including Clojure-contrib, Compojure, and Incanter. &#8230; <a href="http://data-sorcery.org/2010/03/25/getting-started-with-incanter-using-labrepl/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=data-sorcery.org&#038;blog=7974443&#038;post=1532&#038;subd=incanter&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>Stuart Halloway created a great <a href="http://clojure.org">Clojure</a> tutorial and development environment for the <a href="http://pragmaticstudio.com/clojure">PragmaticStudio Clojure workshop</a> called <a href="http://github.com/relevance/labrepl">labrepl</a>, which is available on <a href="http://github.com/relevance/labrepl">Github</a>. A nice feature of labrepl is that is comes with several Clojure libraries, including <a href="http://github.com/richhickey/clojure-contrib">Clojure-contrib</a>, <a href="http://github.com/weavejester/compojure">Compojure</a>, and <a href="http://incanter.org">Incanter</a>. It also includes scripts for starting a Clojure REPL and/or Swank server, and instructions for setting up several different IDEs for Clojure development.</p>
<p>In addition to starting a REPL, the included repl script starts a webserver, on port 8080, that includes several Clojure lab exercises and solutions. </p>
<p>It&#8217;s a great way to get started with Clojure and Incanter, so check it out. And if you&#8217;re an experienced Clojure programmer, Stuart is looking for contributors to create additional labs, so pitch in if you can. I plan to begin by creating some labs covering the material in my <a href="http://data-sorcery.org/2010/02/11/data-sorcery-pt1/">Incanter charts and datasets presentation</a>.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/incanter.wordpress.com/1532/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/incanter.wordpress.com/1532/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=data-sorcery.org&#038;blog=7974443&#038;post=1532&#038;subd=incanter&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://data-sorcery.org/2010/03/25/getting-started-with-incanter-using-labrepl/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/0a0458c58526d153dbc2639eed0d592e?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">liebke</media:title>
		</media:content>
	</item>
	</channel>
</rss>
