add R script for analyzing output