R analysis script.