updated R analysis file