• Share
  • Email
  • Embed
  • Like
  • Save
  • Private Content
How I stopped worrying about figure placement and learned to love Sweave - David Lovell
 

How I stopped worrying about figure placement and learned to love Sweave - David Lovell

on

  • 226 views

As the artilleryman said in War of The Worlds: "It's doing the working and the thinking that wears a fellow out." And so it goes with doing the work of writing a journal paper after all that thinking ...

As the artilleryman said in War of The Worlds: "It's doing the working and the thinking that wears a fellow out." And so it goes with doing the work of writing a journal paper after all that thinking (and R-coding) these past months. All those bits of code, lovingly crafted to work perfectly... but not in the hands of just anyone, no! Just me...and even then, things can go awry. And now those fancy journals come a-prancing, with their talk of formats and conventions. Well, I tell you, I won't be starting all over again. I'VE GOT A PLAN!!!

Statistics

Views

Total Views
226
Views on SlideShare
226
Embed Views
0

Actions

Likes
0
Downloads
5
Comments
0

0 Embeds 0

No embeds

Accessibility

Categories

Upload Details

Uploaded via as Microsoft PowerPoint

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

    How I stopped worrying about figure placement and learned to love Sweave - David Lovell How I stopped worrying about figure placement and learned to love Sweave - David Lovell Presentation Transcript

    • …and learned to love Sweave How I stopped worrying about figure placement David Lovell Bioinformatics FOAM | Melbourne | 14 February 2014 CSIRO COMPUTATIONAL INFORMATICS
    • It's doing the working and the thinking that wears a fellow out
    • I have an idea I want to explore it I explore my idea by writing a computer program I write R code I want to ensure my exploration is reproducible and comprehensible – I explore this idea using literate programming I use Sweave to write both R code and commentary I want to communicate my explorations I communicate my explorations by writing a journal article I write the article according to the journal’s instructions for authors I want to ensure others can reproduce and comprehend my explorations – I include the literate program as Supplementary Information – I use the Supplementary Information figures in the journal article More thinking… less working… How to use Sweave to streamline data analysis and publication How I learned to love Sweave| David Lovell | Page 3
    • More thinking… less working… Workflow How I learned to love Sweave| David Lovell | Page 4 Idea Supplementary Information .Rnw Figure 1.pdf Supplementary Information .aux Supplementary Information .pdf Journal Article .tex Journal Article .pdf
    • Let’s walk through the key steps
    • Let’s start a new project in RStudio
    • Let’s start a new project in RStudio
    • Let’s start a new project in RStudio
    • Let’s start a new project in RStudio
    • Let’s start a new project in RStudio
    • Let’s start a new project in RStudio
    • Let’s start a new project in RStudio
    • Be sure to set the project options…
    • … so as to use knitr to weave .Rnw files
    • You could also set knitr in the global options
    • You could also set knitr in the global options
    • Uncheck this option to keep .aux files
    • Now open a new Sweave (.Rnw) file…
    • Now open a new Sweave (.Rnw) file…
    • …for Supplementar y Information
    • This gives you a skeleton LaTeX file…
    • …add content …compile to PDF…
    • …here’s the compilation report…
    • …and here’s the resulting PDF
    • Now add code to execute on compilation
    • See the result?
    • Now add a “chunk” of code…
    • …here’s the pretty-printed result
    • Here’s a “chunk” that runs silently
    • …here’s the silent result
    • Now here’s a plot that prints immediately
    • See the result? Code first, plot after
    • Here’s a plot in a “floating” figure
    • The figure floats to the top of the page
    • Look at the files created on compilation
    • The .aux file holds labels for cross- reference
    • Compilation also creates figures…
    • …figures named after the chunks
    • Now let’s write that Nature paper…
    • …let’s call it JournalArticle
    • Now we play by Nature’s format rules
    • …still, we can cross- reference Suppl. Info.
    • …here’s a cross- reference
    • …and figures made in the Suppl. Info
    • More thinking… less working… Workflow How I learned to love Sweave| David Lovell | Page 46 Idea Supplementary Information .Rnw Figure 1.pdf Supplementary Information .aux Supplementary Information .pdf Journal Article .tex Journal Article .pdf
    • More thinking… less working… Workflow: write these How I learned to love Sweave| David Lovell | Page 47 Supplementary Information .Rnw Journal Article .tex
    • More thinking… less working… Workflow: submit these How I learned to love Sweave| David Lovell | Page 48 Supplementary Information .Rnw Supplementary Information .pdf Journal Article .tex Journal Article .pdf
    • It's doing the working and the thinking that wears a fellow out
    • Thank you CSIRO Transformational Biology David Lovell Bioinformatics and Analytics Leader t +61 2 6216 7042 e David.Lovell@csiro.au w www.csiro.au/people/David.Lovell CSIRO MATHEMATICS, INFORMATICS AND STATISTICS