Code

Introduction

This page gives the instructions to download data (HDF5), code and any extra R packages to recreate the paper. It assumes that you work on a Unix/mac machine. It may work on Windows too with adaptation, but has not been tested. A recent version of R (3.0.0 or later) is recommended. R is free to download.

Create a new folder

Both code and data can be downloaded and unpacked into a new folder. The variable WAVEREPO_ROOT will point to the directory containing HDF5 files and code.

export WAVEREPO_ROOT=/tmp/mywaverepo/
mkdir -p $WAVEREPO_ROOT

In the next two steps, we download the data files and code and unzip them in this folder just created.

Download the HDF5 files

Download the HDF5 files from CARMEN and unzip them into this folder.

cd $WAVEREPO_ROOT
unzip wh.zip

Reviewers have been given a temporary username and password for CARMEN in the covering letter to the editor. The file wh.zip is also available on my web page.

Get the code files

The code is provided in the manuscript as additional files. wc.zip is also available on my web page.

cd $WAVEREPO_ROOT
unzip wc.zip

Install any packages needed

Several R packages are required to run the analysis. The file waverepo_installs.R contains the code to install the extra R packages. This can be executed using:

cd $WAVEREPO_ROOT
R CMD BATCH waverepo_installs.R

The rhdf5 package takes a few minutes to install. The sjemea package is bundled as part of the code files.

Run the analysis

The file waverepo_paper.Rnw contains the source code to regenerate the paper. To rerun the computations, ensure that the hdf5 folder is in the same directory as the Rnw file. If running on a large multi-core machine, the number of cores can be changed accordingly by editing the option mc.cores (the default is 12 cores). Potential edits in the source document are marked by the phrase USER-EDITS.

Caution, this can take a long time (a few minutes on a modern machine) and assumes you have "pdflatex" installed.

cd $WAVEREPO_ROOT
make

If you want to remove the temporary/working files, simply type make cleanall.