<?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/"
	>

<channel>
	<title>Marios Braindump</title>
	<atom:link href="http://www.mfasold.net/blog/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.mfasold.net/blog</link>
	<description>Just shouting my thoughts out</description>
	<lastBuildDate>Sat, 27 Feb 2010 10:52:25 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Free Photo Backup to Windows Skydrive</title>
		<link>http://www.mfasold.net/blog/2010/02/free-photo-backup-to-windows-skydrive/</link>
		<comments>http://www.mfasold.net/blog/2010/02/free-photo-backup-to-windows-skydrive/#comments</comments>
		<pubDate>Sat, 27 Feb 2010 10:52:25 +0000</pubDate>
		<dc:creator>Mario</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.mfasold.net/blog/?p=429</guid>
		<description><![CDATA[One of my greatest fears is loosing my photo collection, those irretrievable links to good memories. Other physical media (CD, HD) to be stored at home aren&#8217;t save either, therefore I&#8217;d like to have an online backup solution. Windows Live Skydrive features 25GB free storage for files up to 50MB size. Using the free tool [...]]]></description>
			<content:encoded><![CDATA[<p>One of my greatest fears is loosing my photo collection, those irretrievable links to good memories. Other physical media (CD, HD) to be stored at home aren&#8217;t save either, therefore I&#8217;d like to have an online backup solution. Windows Live Skydrive features 25GB free storage for files up to 50MB size. Using the free tool <a href="http://www.cloudstorageexplorer.com">SDExplorer</a> you can also upload your own photo folder structure to the Skydrive. Alternatives are <a href="http://www.gladinet.com/">Gladinet</a> (but the free version allows only 1000 files to be uploaded!) and Windows Live Photo Gallery (each folder has to be uploaded indivually, no subfolders).</p>
]]></content:encoded>
			<wfw:commentRss>http://www.mfasold.net/blog/2010/02/free-photo-backup-to-windows-skydrive/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Python Recipe: Read CSV/TSV Textfiles and Ignore Comment-lines</title>
		<link>http://www.mfasold.net/blog/2010/02/python-recipe-read-csvtsv-textfiles-and-ignore-comment-lines/</link>
		<comments>http://www.mfasold.net/blog/2010/02/python-recipe-read-csvtsv-textfiles-and-ignore-comment-lines/#comments</comments>
		<pubDate>Mon, 15 Feb 2010 15:37:53 +0000</pubDate>
		<dc:creator>Mario</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[english]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[python]]></category>

		<guid isPermaLink="false">http://www.mfasold.net/blog/?p=411</guid>
		<description><![CDATA[Scientific data commonly comes in tab-separated textfile format containing comment lines. What is the best way to read this data? Analogous to the recipe given by skip.montanaro, use a commented file decorator as follows:
import sys, re
import csv
class CommentedFile:
    def __init__(self, f, commentstring="#"):
        self.f = f
 [...]]]></description>
			<content:encoded><![CDATA[<p>Scientific data commonly comes in tab-separated textfile format containing comment lines. What is the best way to read this data? Analogous to the recipe given by <a href="http://bugs.python.org/msg48505">skip.montanaro</a>, use a commented file decorator as follows:</p>
<blockquote><pre>import sys, re
import csv
class CommentedFile:
    def __init__(self, f, commentstring="#"):
        self.f = f
        self.commentstring = commentstring
    def next(self):
        line = self.f.next()
        while line.startswith(self.commentstring):
            line = self.f.next()
        return line
    def __iter__(self):
        return self

tsv_file = csv.reader(CommentedFile(open("inputfile.txt", "rb")),
                      delimiter='\t')
for row in tsv_file:
    print row[2] # prints column 3 of each line</pre>
</blockquote>
]]></content:encoded>
			<wfw:commentRss>http://www.mfasold.net/blog/2010/02/python-recipe-read-csvtsv-textfiles-and-ignore-comment-lines/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>A Reload-Button in Adobe Acrobat</title>
		<link>http://www.mfasold.net/blog/2009/12/a-reload-button-in-adobe-acrobat/</link>
		<comments>http://www.mfasold.net/blog/2009/12/a-reload-button-in-adobe-acrobat/#comments</comments>
		<pubDate>Mon, 21 Dec 2009 13:08:27 +0000</pubDate>
		<dc:creator>Mario</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[english]]></category>
		<category><![CDATA[tech]]></category>

		<guid isPermaLink="false">http://www.mfasold.net/blog/?p=408</guid>
		<description><![CDATA[Read this post about how to reload your pdf document. This is particularly useful when you are creating a new document with LaTeX. Sweet, I was waiting for that functionality.
]]></description>
			<content:encoded><![CDATA[<p>Read <a href="http://www.nonperiodic.net/blog/2009/04/02/reloading-a-file-in-adobe-reader/">this post</a> about how to reload your pdf document. This is particularly useful when you are creating a new document with LaTeX. Sweet, I was waiting for that functionality.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.mfasold.net/blog/2009/12/a-reload-button-in-adobe-acrobat/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Kochmesser Schnäppchen</title>
		<link>http://www.mfasold.net/blog/2009/11/kochmesser-schnappchen/</link>
		<comments>http://www.mfasold.net/blog/2009/11/kochmesser-schnappchen/#comments</comments>
		<pubDate>Mon, 23 Nov 2009 16:36:31 +0000</pubDate>
		<dc:creator>Mario</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[cooking]]></category>
		<category><![CDATA[german]]></category>

		<guid isPermaLink="false">http://www.mfasold.net/blog/?p=398</guid>
		<description><![CDATA[Ein jeder (Hobby-)Koch benötigt ein gutes Kochmesser. Im Weblog Lifehacker wurde vor kurzem ein Messer empfohlen welches eine sehr gute Qualität besitzt, aber statt 100-200$, wie vergleichbare Produkte, nur rund 30$ kostet. Das vom schweizerischen Hersteller Victorinox hergestellte Messer scheint jedoch in dieser Form nur in Amerika erhältlich. Zumindest fand ich es im europäischen Victorinox [...]]]></description>
			<content:encoded><![CDATA[<p>Ein jeder (Hobby-)Koch benötigt ein gutes Kochmesser. Im Weblog <a href="http://lifehacker.com/5390285/victorinox-chefs-knife-performs-like-a-100%252B-knife-for-much-less">Lifehacker</a> wurde vor kurzem ein Messer empfohlen welches eine sehr gute Qualität besitzt, aber statt 100-200$, wie vergleichbare Produkte, nur rund 30$ kostet. Das vom schweizerischen Hersteller Victorinox hergestellte <a href="http://www.amazon.com/exec/obidos/ASIN/B000638D32/">Messer</a> scheint jedoch in dieser Form nur in Amerika erhältlich. Zumindest fand ich es im europäischen Victorinox Katalog nicht wieder. Bei Amazon.com ist es immerhin das meistverkaufteste Messer.</p>
<p>Auf Nachfrage bei Victorinox erhielt ich aber die Information das es in Europa ebenfalls vertrieben wird &#8211; nur mit leicht anderem Bedruck. Die Artikelnummer ist  5.2063.20. Ich habe es bereits gekauft und es macht einen guten Eindruck.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.mfasold.net/blog/2009/11/kochmesser-schnappchen/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Use the new Emacs Daemon!</title>
		<link>http://www.mfasold.net/blog/2009/11/use-the-new-emacs-daemon/</link>
		<comments>http://www.mfasold.net/blog/2009/11/use-the-new-emacs-daemon/#comments</comments>
		<pubDate>Fri, 20 Nov 2009 15:33:22 +0000</pubDate>
		<dc:creator>Mario</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[emacs]]></category>
		<category><![CDATA[english]]></category>
		<category><![CDATA[tech]]></category>

		<guid isPermaLink="false">http://www.mfasold.net/blog/?p=400</guid>
		<description><![CDATA[Emacs usually takes quite some time to fully start up. However, as described in the great blog Emacs-Fu, Emacs 23 can now be started in the background as a daemon. This allows to fire up a new Emacs instance really fast. Thanks djcb!
]]></description>
			<content:encoded><![CDATA[<p>Emacs usually takes quite some time to fully start up. However, as <a href="http://emacs-fu.blogspot.com/2008/12/welcome-to-emacs-fu.html">described</a> in the great blog Emacs-Fu, Emacs 23 can now be started in the background as a daemon. This allows to fire up a new Emacs instance really fast. Thanks djcb!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.mfasold.net/blog/2009/11/use-the-new-emacs-daemon/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Print Particular Lines of a File Using SED</title>
		<link>http://www.mfasold.net/blog/2009/10/print-particular-lines-of-a-file-using-sed/</link>
		<comments>http://www.mfasold.net/blog/2009/10/print-particular-lines-of-a-file-using-sed/#comments</comments>
		<pubDate>Sat, 31 Oct 2009 17:32:56 +0000</pubDate>
		<dc:creator>Mario</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[commandline]]></category>
		<category><![CDATA[english]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[tech]]></category>

		<guid isPermaLink="false">http://www.mfasold.net/blog/?p=394</guid>
		<description><![CDATA[Say you want to print the lines 3 and 7, and all lines from 11 to 15 of a text-file. The following SED one-liner will do for you
sed -n -e '3p' -e '5p' -e '11,15p' textfile.txt
]]></description>
			<content:encoded><![CDATA[<p>Say you want to print the lines 3 and 7, and all lines from 11 to 15 of a text-file. The following SED one-liner will do for you</p>
<blockquote><p><code>sed -n -e '3p' -e '5p' -e '11,15p' textfile.txt</code></p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://www.mfasold.net/blog/2009/10/print-particular-lines-of-a-file-using-sed/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Anycom Bluetooth USB Adapter on Windows 7</title>
		<link>http://www.mfasold.net/blog/2009/10/anycom-bluetooth-usb-adapter-on-windows-7/</link>
		<comments>http://www.mfasold.net/blog/2009/10/anycom-bluetooth-usb-adapter-on-windows-7/#comments</comments>
		<pubDate>Tue, 06 Oct 2009 19:50:17 +0000</pubDate>
		<dc:creator>Mario</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[english]]></category>
		<category><![CDATA[tech]]></category>
		<category><![CDATA[windows]]></category>

		<guid isPermaLink="false">http://www.mfasold.net/blog/?p=381</guid>
		<description><![CDATA[For the first time I could personally sense the effects of the economic crisis. The manufacturer of my Bluetooth device ANYCOM USB-200, the Germany-based ITM Technology AG is insolvent. Immediate effect for customers like me: No more driver updates and their general unavailability on the homepage.
Here is the good news for everybody who wants to [...]]]></description>
			<content:encoded><![CDATA[<p>For the first time I could personally sense the effects of the economic crisis. The manufacturer of my Bluetooth device ANYCOM USB-200, the Germany-based ITM Technology AG is insolvent. Immediate effect for customers like me: No more driver updates and their general unavailability on the homepage.</p>
<p>Here is the good news for everybody who wants to use an ANYCOM Bluetooth USB adapter (200, 250, 500) on Windows 7. The Vista driver runs just fine under Windows 7. And I got the driver (	&#8220;anycom-bluetooth-usb200-250-500-vista-v6-1-0-4700.exe&#8221;). If anybody needs it, feel free to send me an email (see <a href="http://www.mfasold.net/blog/about/">About</a>). It may be worth noting that Windows 7 complains about not being able to correctly install Bluetooth devices like a headset (Plantronics Voyager 510 for me), while in fact you you only need the correct driver for the adapter.</p>
<p><em>Update: After brisk demand I decided to allow you to <a href="http://www.mfasold.net/anycom-bluetooth-usb200-250-500-vista-v6-1-0-4700.exe">download the driver</a> directly from this website. Of course, no warranty whatsoever provided.</em></p>
]]></content:encoded>
			<wfw:commentRss>http://www.mfasold.net/blog/2009/10/anycom-bluetooth-usb-adapter-on-windows-7/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Working with a List of Tuples in Shell Scripting</title>
		<link>http://www.mfasold.net/blog/2009/10/working-with-a-list-of-tuples-in-shell-scripting/</link>
		<comments>http://www.mfasold.net/blog/2009/10/working-with-a-list-of-tuples-in-shell-scripting/#comments</comments>
		<pubDate>Fri, 02 Oct 2009 13:08:17 +0000</pubDate>
		<dc:creator>Mario</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[commandline]]></category>
		<category><![CDATA[english]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[scripting]]></category>
		<category><![CDATA[tech]]></category>

		<guid isPermaLink="false">http://www.mfasold.net/blog/?p=367</guid>
		<description><![CDATA[Several people have recently asked me whether or not it is possible to use tuples in their shell script. One example is running a program with a varying set of parameters. Since they often did not find a good solution, they began to formulate their problem in a higher-level scripting language like Ruby. Surprisingly, you [...]]]></description>
			<content:encoded><![CDATA[<p>Several people have recently asked me whether or not it is possible to use tuples in their shell script. One example is running a program with a varying set of parameters. Since they often did not find a good solution, they began to formulate their problem in a higher-level scripting language like Ruby. Surprisingly, you can accomplish the same task easily with simple shell scripting (supported by bash, zsh,..). Consider the following (semi-stupid) example</p>
<blockquote><p><code>#!/bin/bash<br />
paramset="foo.txt 1 --with-graphics<br />
bar.txt 8 --no-graphics<br />
flock.txt 4 --with-graphics"</code></p>
<p><code>echo "$du" | while read file p1 p2 ; do<br />
     ./myProgram $file -t $p1 --verbose $p2<br />
done</code></p></blockquote>
<p>We here run the program <code>myProgram</code> three times (for each line in the multi-line string). Every line contains three white-space separated values (words), to which we assign the variable names <code>file, p1, p2</code> in the loop header. Note that the last variable (in this case <code>p2</code>) always contains all remaining words of a given line if there are more words then variables.</p>
<p>The set of parameters can also be stored in a file. In that case, replace the loop header with <code>cat params.txt  | while read file p1 p2 ; do</code>. If the script is not working properly, examine the Input-Field-Separator (IFS) variable, which should be set to <code>IFS=" "</code>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.mfasold.net/blog/2009/10/working-with-a-list-of-tuples-in-shell-scripting/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Scotland Photos</title>
		<link>http://www.mfasold.net/blog/2009/09/scotland-photos/</link>
		<comments>http://www.mfasold.net/blog/2009/09/scotland-photos/#comments</comments>
		<pubDate>Tue, 15 Sep 2009 19:32:01 +0000</pubDate>
		<dc:creator>Mario</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[photos]]></category>

		<guid isPermaLink="false">http://www.mfasold.net/blog/?p=339</guid>
		<description><![CDATA[ Here are some impressions from my recent trip to the Scotland. It really is a lovely place to travel. The route included places like Stirling, Fort Williams, Isle of Skye, Glenfinnan and more.

]]></description>
			<content:encoded><![CDATA[<p><img class="alignleft size-thumbnail wp-image-347" title="IMG_3409" src="http://www.mfasold.net/blog/wp-content/uploads/IMG_3409-100x100.jpg" alt="IMG_3409" width="100" height="100" /> Here are some impressions from my recent trip to the Scotland. It really is a lovely place to travel. The route included places like Stirling, Fort Williams, Isle of Skye, Glenfinnan and more.</p>
<p><span id="more-339"></span></p>

<a href='http://www.mfasold.net/blog/2009/09/scotland-photos/img_3593/' title='IMG_3593'><img width="100" height="100" src="http://www.mfasold.net/blog/wp-content/uploads/IMG_3593-100x100.jpg" class="attachment-thumbnail" alt="" title="IMG_3593" /></a>
<a href='http://www.mfasold.net/blog/2009/09/scotland-photos/img_3211/' title='IMG_3211'><img width="100" height="100" src="http://www.mfasold.net/blog/wp-content/uploads/IMG_3211-100x100.jpg" class="attachment-thumbnail" alt="" title="IMG_3211" /></a>
<a href='http://www.mfasold.net/blog/2009/09/scotland-photos/img_3275/' title='IMG_3275'><img width="100" height="100" src="http://www.mfasold.net/blog/wp-content/uploads/IMG_3275-100x100.jpg" class="attachment-thumbnail" alt="" title="IMG_3275" /></a>
<a href='http://www.mfasold.net/blog/2009/09/scotland-photos/img_3293/' title='IMG_3293'><img width="100" height="100" src="http://www.mfasold.net/blog/wp-content/uploads/IMG_3293-100x100.jpg" class="attachment-thumbnail" alt="" title="IMG_3293" /></a>
<a href='http://www.mfasold.net/blog/2009/09/scotland-photos/img_3368/' title='IMG_3368'><img width="100" height="100" src="http://www.mfasold.net/blog/wp-content/uploads/IMG_3368-100x100.jpg" class="attachment-thumbnail" alt="" title="IMG_3368" /></a>
<a href='http://www.mfasold.net/blog/2009/09/scotland-photos/img_3396/' title='IMG_3396'><img width="100" height="100" src="http://www.mfasold.net/blog/wp-content/uploads/IMG_3396-100x100.jpg" class="attachment-thumbnail" alt="" title="IMG_3396" /></a>
<a href='http://www.mfasold.net/blog/2009/09/scotland-photos/img_3406/' title='IMG_3406'><img width="100" height="100" src="http://www.mfasold.net/blog/wp-content/uploads/IMG_3406-100x100.jpg" class="attachment-thumbnail" alt="" title="IMG_3406" /></a>
<a href='http://www.mfasold.net/blog/2009/09/scotland-photos/img_3409/' title='IMG_3409'><img width="100" height="100" src="http://www.mfasold.net/blog/wp-content/uploads/IMG_3409-100x100.jpg" class="attachment-thumbnail" alt="" title="IMG_3409" /></a>
<a href='http://www.mfasold.net/blog/2009/09/scotland-photos/img_3424/' title='IMG_3424'><img width="100" height="100" src="http://www.mfasold.net/blog/wp-content/uploads/IMG_3424-100x100.jpg" class="attachment-thumbnail" alt="" title="IMG_3424" /></a>
<a href='http://www.mfasold.net/blog/2009/09/scotland-photos/img_3467/' title='IMG_3467'><img width="100" height="100" src="http://www.mfasold.net/blog/wp-content/uploads/IMG_3467-100x100.jpg" class="attachment-thumbnail" alt="" title="IMG_3467" /></a>
<a href='http://www.mfasold.net/blog/2009/09/scotland-photos/img_3489/' title='IMG_3489'><img width="100" height="100" src="http://www.mfasold.net/blog/wp-content/uploads/IMG_3489-100x100.jpg" class="attachment-thumbnail" alt="" title="IMG_3489" /></a>
<a href='http://www.mfasold.net/blog/2009/09/scotland-photos/img_3578/' title='IMG_3578'><img width="100" height="100" src="http://www.mfasold.net/blog/wp-content/uploads/IMG_3578-100x100.jpg" class="attachment-thumbnail" alt="" title="IMG_3578" /></a>
<a href='http://www.mfasold.net/blog/2009/09/scotland-photos/img_3588/' title='IMG_3588'><img width="100" height="100" src="http://www.mfasold.net/blog/wp-content/uploads/IMG_3588-100x100.jpg" class="attachment-thumbnail" alt="" title="IMG_3588" /></a>

]]></content:encoded>
			<wfw:commentRss>http://www.mfasold.net/blog/2009/09/scotland-photos/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Inline Figures in Org-Mode Paper Drafts</title>
		<link>http://www.mfasold.net/blog/2009/07/inline-figures-in-org-mode-paper-drafts/</link>
		<comments>http://www.mfasold.net/blog/2009/07/inline-figures-in-org-mode-paper-drafts/#comments</comments>
		<pubDate>Wed, 08 Jul 2009 13:46:43 +0000</pubDate>
		<dc:creator>Mario</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[emacs]]></category>
		<category><![CDATA[english]]></category>
		<category><![CDATA[R]]></category>
		<category><![CDATA[science]]></category>

		<guid isPermaLink="false">http://www.mfasold.net/blog/?p=315</guid>
		<description><![CDATA[Writing a paper often comes along with a problem known as information fragmentation: figures, tables and the respective data sources related to the paper certainly are somewhere on your hard disk &#8211; but where? How did I name the file with the data-points again? And, the heck, which commands did I use to create that [...]]]></description>
			<content:encoded><![CDATA[<p>Writing a paper often comes along with a problem known as information fragmentation: figures, tables and the respective data sources related to the paper certainly are somewhere on your hard disk &#8211; but where? How did I name the file with the data-points again? And, the heck, which commands did I use to create that fancy plot? But chill, there is a way to avoid the joyless seeking and re-finding. At least if you <a href="http://www.mfasold.net/blog/2009/02/using-emacs-org-mode-to-draft-papers/">draft your papers in org-mode</a>, as I described in a recent post.</p>
<p><span id="more-315"></span>The key tool here is the wonderful org-mode extension Org-R by Dan Davison. It allows to include code fragments that create figures or tables directly into your document. That way, everything will be in one place.  Searching, au revoir.</p>
<p><strong>Introduction to Org-R</strong></p>
<p>Luckily, Dan wrote a <a href="http://orgmode.org/worg/org-tutorials/org-R/org-R.php">comprehensive tutorial</a> on how to use org-R. If your planning to give it a try, I suggest to look over his words first. However, he forgot to mention two things you&#8217;ll need to enable the org-R goodness. Insert</p>
<blockquote><p>(add-to-list &#8216;load-path &#8220;~/site-lisp/org-mode/contrib/lisp&#8221;)<br />
(require &#8216;org-R)</p></blockquote>
<p>into your .emacs and edit the directory to point into your org-mode directory. Also, you need to have a R instance running (invoke <code>M-x R</code>) in the directory of your document. Try some of the examples given in his tutorial in a new .org document now.</p>
<p>What happens behind the scenes here is that org-R translates the inline commands into a R command sequence. For example, <code>infile:x.csv</code> is converted into <code>x = read.table(...)</code> . The <code>+RR</code> prefix introduces direct R commands, which are executed before the <code>+R</code> commands (except infile:). The result is then inserted as a table or as a link to a graphic. Note that many actions rely on conventions:  <code>outfile:x.png</code> will create a png image. Reading from a datafile will only work if the file suffix is .csv. And its contents will always be stored in a variable x. If you are not sure what is happening behind the scenes, the command <code>showcode:t</code> shows you the created R-code and is hence a great tool for debugging.</p>
<p><strong>Using figures</strong></p>
<p>A typical fragment for creating a figure that is also exported into LaTeX/PDF/HTML properly is</p>
<blockquote><p>#+CAPTION: Distribution of foot sizes among coputer scientists<br />
#+LABEL: fig:SizeDistribution<br />
#+ATTR_LaTeX: scale=0.5<br />
[[file:images/distanceDist.png]]<br />
#+R: infile:&#8221;tmp.csv&#8221; #+R: action:density columns:1 args:(:lwd 4)<br />
#+R: outfile:&#8221;images/distanceDist.png&#8221;<br />
#+R: inline:t</p></blockquote>
<p>The first three lines give the image a caption and a reference, and define the size of the image in the paper. Invoking C-c (or <code>org-apply</code>) in the second part will (re-)create the image. The command <code>#+R: inline:t</code> is required for the resulting link to the image having the same format as the LaTeX exporter recognizes for figures.</p>
<p><strong>Keeping your document clean</strong></p>
<p>The main intend of org-R obviously was to enable org-mode users to perform quick calculations and create simple graphs from data that originates from org-tables. Undeniable, org-r is very good at that. However, our objective shall rather be to centralize and de-fragment drafting of papers containing complex figures. When it comes to more elaborate graphs and datasets, the usefulness of  the predefined actions vanishes and longer, more complex R code is required. You might rather want to work in ESS/R-mode, where you have all the coloring and intendation niceness, and you do not have to precede every line with an +RR:.</p>
<p>The alternative is to source the functions from a separate .R file, for example you could use</p>
<blockquote><p>#+CAPTION: Distribution of finger lengths among computer scientists<br />
#+ATTR_LaTeX: scale=0.5<br />
#+LABEL: fig:LengthDistribution<br />
[[file:images/distanceDist.png]]<br />
#+R: infile:&#8221;tmp.csv&#8221;<br />
#+RR: source(&#8221;rcode.R&#8221;)<br />
#+RR: myDensity(x)<br />
#+R: outfile:&#8221;images/distanceDist.png&#8221;<br />
#+R: inline:t</p></blockquote>
<p>with the following code (imagine a longer fragment) in rcode.R</p>
<blockquote><p>myDensity &lt;- function(x) {  <br />
    plot(density(x[,1]), col=&#8221;chartreuse4&#8243;, lwd=5, xlim=c(0,2000))<br />
}</p></blockquote>
<p>That way, you avoid immense R code pollution in your draft, yet you have all the information (data-files, linked code and parameters) in one place. Happy drafting!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.mfasold.net/blog/2009/07/inline-figures-in-org-mode-paper-drafts/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
