R code for my blog post on the shift function: https://garstats.wordpress.com/2016/07/12/shift-function/
shift_function_demo.R generates all the figures presented in the post.
All the dependencies are listed at the beginning of the file:
in addition to packages ggplot2 & cowplot, a few house-made toolboxes are provided as text files,
which are available here:
https://github.com/GRousselet/rstats
The main R functions are available on Rand Wilcox’s website - I’ve included the official current version, as of writing, as Rallfun-v30.txt.
Datasets are either generated in the demo file, or loaded from text files - ensure all the files in this folder are in your working directory.
You can see the shift function in action here for instance:
http://onlinelibrary.wiley.com/doi/10.1111/ejn.13100/full
http://www.frontiersin.org/Perception_Science/10.3389/fpsyg.2011.00137/