1 [[!meta title="Introducing Sweavealike"]]
3 I use [R](http://www.r-project.org) a lot. It's one of the primary
4 tools I use in my day job as a scientist analyzing large datasets. If
5 you use [LaTeX](http://ctan.org) with R (as I often do), you probably
6 use Sweave to interleave R output and figures with your text
7 describing those figures using the noweb method of literate
10 [Sweavealike](http://git.donarmstrong.com/?p=ikiwiki_plugins.git;a=blob;f=sweavealike.pm;hb=HEAD)
11 is a plugin for [IkiWiki](http://ikiwiki.info) that tries
12 to do some of the useful things for IkiWiki that sweave does for R and
15 You use it like the following:
17 \[[!sweavealike echo=1 code="""
23 which produces this result when run:
25 [[!sweavealike echo=1 code="""
31 You can also generate figures with it:
33 \[[!sweavealike fig=1 echo=1 results="hide" code="""
34 plot(1:10,(1:10)^2,xlab="x",ylab=expression(x^2),main="Example Figure")
37 [[!sweavealike fig=1 echo=1 results="hide" code="""
38 plot(1:10,(1:10)^2,xlab="x",ylab=expression(x^2),main="Example Figure")
41 The plugin itself uses the neat Statistics::R perl module to handle
42 all of the heavy lifting. I personally plan on using this plugin to
43 help write some more entries in my learning R series of posts that I'm
44 beginning to work on. Hopefully I'll find and fix most of the bugs as
45 I embark on that process so anyone else who uses the plugin won't, but
46 feel free to e-mail me if something isn't working as it should.
48 Finally, you shouldn't run this plugin on a publicly editable
49 IkiWiki instance, because that would be a trivial local user exploit
50 as R can run arbitrary code, read and write to arbitrary files,
51 exhaust all memory, etc.
53 [[!tag ikiwiki debian tech r]]