Documentation website:

Accompanying paper in Journal of Open Source Software:


We are not (yet) on CRAN but the package can be installed via:

#install.packages("devtools") # if devtools is not installed

Please note that vignettes are not built by default. To build vignettes as well, please use the following code:

devtools::install_github("ropensci/workloopR", build_vignettes = TRUE)


workloopR (pronounced “work looper”) provides functions for the import, transformation, and analysis of muscle physiology experiments in R. As the package’s title suggests, our initial motivation was to provide functions to analyze work loops. The work loop technique (Josephson 1985) is used in studies of muscle physiology to determine the mechanical work and power output of a muscle. Over the course of developing the package, we expanded this goal to also cover experiments that are often complementary to the work loop technique. There are three currently supported experiment types: work loop, simple twitch, and tetanus.

Figure 1

For more on work loops, we recommend a great review paper by Ahn (2012) as well as this Wikipedia page.


workloopR offers the ability to import, transform, and then analyze a data file. Here is an example using a work loop file included within the package:


## import the workloop.ddf file included in workloopR
wl_dat <- read_ddf(system.file("extdata", "workloop.ddf",
                               package = 'workloopR'),
                  phase_from_peak = TRUE)

## select cycles 3 through 5 using a peak-to-peak definition
wl_selected <- select_cycles(wl_dat, cycle_def = "p2p", keep_cycles = 3:5)

## apply a gear ratio correction, run the analysis function,
## and then get the full object
wl_analyzed <- analyze_workloop(wl_selected, GR = 2)
## for brevity, the print() method for this object produces a simple output
## but see the structure for the full output, e.g.

## or run the analysis but get the simplified version
wl_analyzed_simple <- analyze_workloop(wl_selected, simplify = TRUE, GR = 2)

Graphical overview

Recommended functions and vignettes:

Figure 2


The preferred way to cite workloopR is:

Baliga VB and Senthivasan S. 2019. workloopR: Analysis of work loops and other data from muscle physiology experiments in R. Journal of Open Source Software, 4(43), 1856,


Feedback is welcome! Please feel free to get in touch with either Vikram (@vbaliga) or Shree (@shreeramsenthi).

We are happy to take feature requests, especially those that involve data import from non-ddf file types. Please see our Issues page for templates that you can use.



GPL (>= 3) + file LICENSE