Fast-track publishing using the new R markdown – a tutorial and a quick look behind the scenes

The new rmarkdown revolution has started. The image is CC by Jonathan Cohen.

The new rmarkdown revolution has started. The image is CC by Jonathan Cohen.

The new R Markdown (rmarkdown-package) introduced in Rstudio 0.98.978 provides some neat features by combining the awesome knitr-package and the pandoc-system. The system allows for some neat simplifications of the fast-track-publishing (ftp) idea using so called formats. I’ve created a new package, the Grmd-package, with an extension to the html_document format, called the docx_document. The formatter allows an almost pain-free preparing of MS Word compatible web-pages.

In this post I’ll (1) give a tutorial on how to use the docx_document, (2) go behind the scenes of the new rmarkdown-package and RStudio ≥ 0.98.978, (3) show what problems currently exists when skipping some of the steps outlined in the tutorial. Continue reading

My thesis: patient-related factors & hip arthroplasty outcomes

Title: Evaluation of patient related factors influencing outcomes after total hip replacement

Title: Evaluation of patient related factors influencing outcomes after total hip replacement

On May 29:th I successfully defended my thesis at the Karolinska Institute and I’m now a “Doctor of Philosophy“, i.e. PhD. It has been a fun and rewarding project that spurred me into starting this blog and diving into R. Below you can find the thesis abstract and my reflections on the subject. Continue reading

Drawing a directed acyclic graph (DAG) for blood transfusions after surgery

A directed acyclic graph (DAG) can help you take the right path. The image is CC by Ian Sane

A DAG can help you take the right path. The image is CC by Ian Sane

I recently wrote about blood transfusions and their inherent risk of postoperative infections. This post is a tutorial on some of the basics of drawing a directed acyclic graph (DAG). Blood transfusions and infections is a great topic as most are familiar with risk factors for infections. Continue reading

The final nail in the coffin for the degenerative meniscus?

Some studies give time for pause. The image is CC by Matt Katzenberger.

Some studies give time for pause. The image is CC by Matt Katzenberger.

I have my doubts when it comes to operating a degenerative meniscus (see my previous post) and in an amazing Finnish multicenter RCT it seems that my doubts have been confirmed. Sihvonen et al. managed to randomize 146 patients to arthroscopic meniscal or sham surgery where none of the outcomes differed between the groups. Continue reading

A bloody mess?

Do blood transfusions cause infections? The image is CC by Peter Almay.

Do blood transfusions cause infections? The image is CC by Peter Almay.

Blood transfusions lower the immune response – a known fact although not all doctors are aware of it. It is therefore nice to see that two new articles in JBJS that focus on the subject. Both focus on arthroplasties where the impact of an infection due to a lowered immune response can be catastrophic to the individual. Continue reading

Pimping your forest plot

A forest plot using different markers for the two groups

A forest plot using different markers for the two groups

In order to celebrate my Gmisc-package being on CRAN I decided to pimp up the forestplot2 function. I had a post on this subject and one of the suggestions I got from the comments was the ability to change the default box marker to something else. This idea had been in my mind for a while and I therefore put it into practice. Continue reading

The rotator cuff dilemma – revisited

A black-shouldered kite with prey. The image is CC by Tariq Sani.

A black-shouldered kite with prey. The image is CC by Tariq Sani.

Is Kukkonen et. al.’s RCT the end of our love for the rotator cuff tear? The industry surrounding rotator cuff tears costs in the US alone about $3 billion every year, earning a top position among common orthopaedic procedures. I have previously written about my doubts concerning this procedure and it is with some satisfaction that I dive in to this recent study by Kukkonen et. al.

It is better to have loved and lost, than never to have loved at all.

Alfred Lord Tennyson

Continue reading

Fast-track publishing using knitr: stitching it together (part V)

Putting all the pieces together can be challenging both for surgeons and researchers. The image is CC by Zac Peckler

Putting all the pieces together can be challenging both for surgeons and researchers. The image is CC by Zac Peckler

Fast-track publishing using knitr is a short series on how I use knitr to speedup publishing in my research. There has been plenty of feedback and interest for the series, and in this post I would like to provide (1) a brief summary and (2) an example showing how to put all the pieces together. Continue reading

Fast-track publishing using knitr: table mania (part IV)

Constructing tables is an art - maximizing readability and information can be challenging. The image is of the Turning Torso in Malmö and is CC by Alan Lam.

Constructing tables is an art – maximizing readability and information can be challenging. The image is of the Turning Torso in Malmö and is CC by Alan Lam.

Fast-track publishing using knitr is a short series on how I use knitr to speedup publishing in my research. While illustrations (previous post) are optional, tables are not, and this fourth article is therefore devoted to tables. Tables through knitr is probably one of the most powerful fast-track publishing tools, in this article I will show (1) how to quickly generate a descriptive table, (2) how to convert your regression model into a table, and (3) worth knowing about table design and anatomy. Continue reading