Tag Archives: R

Writing reproducibly in the open with knitr

Sweave is some­thing of a gold stan­dard in repro­ducible research. It cre­ates a dynamic doc­u­ment, writ­ten in a mix of LaTeX and R code where the results of the analy­sis (num­bers, fig­ures, tables) are auto­mat­i­cally gen­er­ated from the code and inserted into the result­ing pdf doc­u­ment, mak­ing them easy to update if the data or

Citations in markdown using knitr

I am find­ing myself more and more drawn to mark­down rather then tex/Rnw as my stan­dard for­mat (not least of which is the ease of dis­play­ing the files on github, par­tic­u­larly now that we have auto­matic image upload­ing). One thing I miss from latex is the cita­tion com­mands. (I under­stand these can be pro­vided to

knitr, github, and a new phase for the lab notebook

I have recently mod­i­fied the basic work­flow of my lab note­book since dis­cov­er­ing knitr. Before, I would write code files which I could track on github, push fig­ures cre­ated by the code to flickr, and then write a note­book entry on word­press describ­ing what I was doing. I’d embed each fig­ure I wanted into the

Citing R packages

I’m not always care­ful in cit­ing all the R pack­ages I use. R actu­ally has some rather nice built-in mech­a­nisms to sup­port this, so I really have no excuse. Here’s some quick exam­ples: To cite the ouch pack­age in pub­li­ca­tions use: Aaron A. King and Mar­guerite A. But­ler (2009), ouch: Ornstein-Uhlenbeck mod­els for phy­lo­ge­netic com­par­a­tive

Elegant & fast data manipulation with data.table

Just learned about the R data.table pack­age (ht @recology_) makes R data frames into ultra-fast, SQL-like objects. One thing we get is some very nice and pow­er­ful syn­tax. Con­sider some sim­ple data of repli­cate time series: To apply a func­tion to each set of repli­cates, instead of We can use: Note that we could have passed

Is your phylogeny informative?

Yes­ter­day my paper   appeared in early view in Evo­lu­tion (author’s preprint),1 so I’d like to take this chance to share the back-story and high­light my own view on some of our find­ings, and the asso­ci­ated pack­age on CRAN.2 I didn’t set out to write this paper.  I set out to write a very dif­fer­ent

treebase package on cran

My tree­base pack­age is now up on the CRAN repos­i­tory. (Source code is up, the bina­ries should appear soon). Here’s a few intro­duc­tory exam­ples to illus­trate some of the func­tion­al­ity of the pack­age. Thanks in part to new data depo­si­tion require­ments at jour­nals such as Evo­lu­tion, Am Nat, and Sys Bio, and data man­age­ment plan

Showcasing the latest phylogenetic methods: AUTEUR

While high-speed fish feed­ing videos may be the sig­na­ture of the lab, dig a bit deeper and you’ll find a wealth of com­par­a­tive phy­lo­ge­netic meth­ods sneak­ing in.  It’s a nat­ural union — expert func­tional mor­phol­ogy is the key to good com­par­a­tive meth­ods, just as phy­lo­ge­nies hold the key to untan­gling the evo­lu­tion­ary ori­gins of that

TreeBASE in R: a first tutorial

My Tree­BASE R pack­age is essen­tially func­tional now.  Here’s a quick tuto­r­ial on the kinds of things it can do.  Grab the tree­base pack­age here, install and load the library into R. Tree­BASE pro­vides two APIs to query the data­base, one which searches by the meta­data asso­ci­ated with dif­fer­ent pub­li­ca­tions (called OAI-PMH), and another which queries

socialR: Reproducible Research & Notebook integration with R

I’ve cre­ated an R pack­age that uses social media tools for repro­ducible research.  The goal of the pack­age is this: when­ever I run a code, out­put fig­ures are auto­mat­i­cally added to my fig­ure repos­i­tory (Flickr), linked to the time­stamped ver­sion of the code that pro­duced them in the code repos­i­tory.  Fig­ures should be tagged by