R analysis script for nardiff.simple